Hi,
I have to NIC tith below info:
- NIC1 :
IP : 10.10.10.5
Netmask : 255.255.255.255
eth : eth0
NIC2 :
IP : 10.10.10.6
Netmask : 255.255.255.255
eth : eth1
My gateway for both of these IPs is 10.10.10.1/32
I can successfully route these IPs using below command :
Code:
Append these two lines to /etc/iproute2/rt_tables
200 nic1
201 nic2
route add -net 10.10.10.1 netmask 255.255.255.255 dev eth0
route add -net 10.10.10.1 netmask 255.255.255.255 dev eth1
route add default gw 10.10.10.1 dev eth0
route add default gw 10.10.10.1 dev eth1
ip route add 0/0 via 10.10.10.1 dev eth0 table nic1
ip route add 0/0 via 10.10.10.1 dev eth1 table nic2
ip rule add from 10.10.10.5 table nic1
ip rule add to 10.10.10.5 table nic1
ip rule add from 10.10.10.6 table nic2
ip rule add to 10.10.10.6 table nic2
but unfortunately i can not persist these routes ant rules in route-ethX and rule-ethX.
Also when I'm using
ip route command instead od
route add these routes did not work anymore.
anybody can help me.