Coogan
April 14th, 2013, 05:50 AM
I've got multiple NICs in my Ubuntu server; two (eth0, eth2) are on the same network. Until today, I was running 10.04 server and had fixed the problem of asymmetrical routing by using the steps in this article (http://www.linuxjournal.com/article/7291?page=0,1). Basically, I added the following to the kernel routing table:
> ip route add default via 192.168.1.140 dev eth0 tab 1
> ip route add default via 192.168.1.140 dev eth2 tab 2
> ip rule add from 192.168.1.100/32 tab 1 priority 500
> ip rule add from 192.168.1.102/32 tab 2 priority 600
Briefly, the setup.
192.168.1.100: eth0
192.168.1.102: eth2 (eth1 is inactive)
192.168.1.140: Gateway
Using the ip routing changes above I was able to segregate traffic - responses to data coming in eth0 goes out eth0, and responses to data coming in eth2 goes out eth2. Easy.
This no longer appears to work now that I've upgraded to 12.04. The ip route commands are taken, but only the first one entered seems to take effect - whichever one is entered second is seemingly ignored:
ip route show
default via 192.168.1.140 dev eth0
169.254.0.0/16 dev eth2 scope link metric 1000
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.102
ip route show table 1
default via 192.168.1.140 dev eth0
ip route show table 2
default via 192.168.1.140 dev eth2
netstat -anr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.140 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
As shown above, only one interface (eth0) can get outside my LAN. The other interface (eth2) can connect inside the LAN, but cannot leave the network.
So I've really got two problems - asymmetrical routing, and only one interface can leave the network. Both were solved with some simple commands in 10.04, but these no longer work in 12.04.
I've googled a lot for the in the last few hours, but nothing seems to be working.
Coogan
> ip route add default via 192.168.1.140 dev eth0 tab 1
> ip route add default via 192.168.1.140 dev eth2 tab 2
> ip rule add from 192.168.1.100/32 tab 1 priority 500
> ip rule add from 192.168.1.102/32 tab 2 priority 600
Briefly, the setup.
192.168.1.100: eth0
192.168.1.102: eth2 (eth1 is inactive)
192.168.1.140: Gateway
Using the ip routing changes above I was able to segregate traffic - responses to data coming in eth0 goes out eth0, and responses to data coming in eth2 goes out eth2. Easy.
This no longer appears to work now that I've upgraded to 12.04. The ip route commands are taken, but only the first one entered seems to take effect - whichever one is entered second is seemingly ignored:
ip route show
default via 192.168.1.140 dev eth0
169.254.0.0/16 dev eth2 scope link metric 1000
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.100
192.168.1.0/24 dev eth2 proto kernel scope link src 192.168.1.102
ip route show table 1
default via 192.168.1.140 dev eth0
ip route show table 2
default via 192.168.1.140 dev eth2
netstat -anr
Kernel IP routing table
Destination Gateway Genmask Flags MSS Window irtt Iface
0.0.0.0 192.168.1.140 0.0.0.0 UG 0 0 0 eth0
169.254.0.0 0.0.0.0 255.255.0.0 U 0 0 0 eth2
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
192.168.1.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
As shown above, only one interface (eth0) can get outside my LAN. The other interface (eth2) can connect inside the LAN, but cannot leave the network.
So I've really got two problems - asymmetrical routing, and only one interface can leave the network. Both were solved with some simple commands in 10.04, but these no longer work in 12.04.
I've googled a lot for the in the last few hours, but nothing seems to be working.
Coogan