You are not logged in.
Hi there,
I think the subject is little confusing, here's the details.
I have two network interface. eth0 and eth1, both accessible to internet.
How ip route looks like
default via 192.168.1.1 dev eth0
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.21
192.168.99.0/24 dev eth1 proto kernel scope link src 192.168.99.21
All traffic route to eth0(gateway: 192.168.1.1) by default, I want to make specific website or IP address route to eth1 (gateway: 192.168.99.1), how can I do that?
Thank you.
Offline
Online
Assuming your gateway for the 192.168.99.0/24 subnet is 192.168.99.1, I would simply go with
ip route add <ip> via 192.168.99.1 dev eth1
Or does that not work? What have you tried so far?
Thanks for reply, I just solved by creating a new route table.
ip link set eth1 up
ip addr add 192.168.99.21/24 broadcast 192.168.99.255 dev eth1
ip route add table rt1 default via 192.168.99.1
ip rule add to <ip> table rt1
Offline