Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am trying to setup an Ubuntu hosting server, currently just for development, and the server has two NICs, each sitting on a different network. eth0 is on 192.168.200.* and eth1 is on 192.168.101.* and each one has a static IP. eth0 is the public facing NIC card and eth1 is strictly for internal access to the server. I initially only setup eth0 and added the eth1 card when I needed it. eth0 was working find until I added eth1, now, can't get any connectivity on eth0 unless I pull eth1 out of the box. The configuration on each system is as follows:

auto eth0
iface eth0 inet static
      address 192.168.200.94
      netmask 255.255.255.0
      network 192.168.200.0
      broadcast 192.168.200.255
      gateway 192.168.200.253

auto eth1
iface eth1 inet static
      address 192.168.101.64
      netmask 255.255.255.0
      network 192.168.101.0
      broadcast 192.168.101.255
      gateway 192.168.101.254

Again eth0 worked fine until I added eth1. I have seen this happen with Windows servers if you have a Default Gateway setup for both NICs, but I am not sure if this works the same on Ubuntu. My resolv.conf file looks like so:

nameserver 192.168.101.59
nameserver 192.168.101.58
domain domain.local
search domain.local

Per request here is the Routing table

192.168.101.0       *                   255.255.255.0     U     0      0      0      eth1
192.168.200.0       *                   255.255.255.0     U     0      0      0      eth0
default             192.168.101.254     0.0.0.0           UG    100    0      0      eth1
default             192.168.200.253     0.0.0.0           UG    100    0      0      eth0
share|improve this question
    
I could be a route issue. Please add the output of the route command. –  Javier Rivera Jan 20 '11 at 16:19
    
Following to see if I can gain any insight to accomplish the same goal. (askubuntu.com/questions/19900/dual-lan-printing) –  user8290 Jan 20 '11 at 23:39
    
can you ping or traceroute to your gateways? I.e., 192.168.200.253 and 192.168.101.254 ? What's the ouput of ifconfig -a ? –  belacq Feb 14 '11 at 19:08

2 Answers 2

You have two default routes. It's possible that your "192.168.101.254" box is not configured to route your traffic out, since you said that that network it's strictly for internal access.

Remove the "gateway" entry from the eth1 network and it should work.

share|improve this answer
    
I removed the line that says "gateway 192.168.101.254" but it still doesn't seem to work. Is there anything else I need to add to the interfaces file? And yes I did restart networking (using "/etc/init.d/networking restart") –  Dave Long Jan 20 '11 at 18:12
1  
please paste the output of traceroute 8.8.8.8 –  ithkuil Jan 28 '11 at 13:42
    
Do you still see the two default routes after removing the second gateway line and restarting the networking? –  Jeremy Kerr Feb 15 '11 at 4:28

keep the gateway entry for eth1 and remove the gateway entry for eth0:

ip route del default dev eth0

create a new policy routing table:

echo "1 admin" >> /etc/iproute2/rt_tables

add the new routes:

ip route add 192.168.200.0/24 dev eth0 src 192.168.200.94 table admin

ip route add default via 192.168.200.253 dev eth0 table admin

add the new rules:

ip rule add from 192.168.200.94/32 table admin

ip rule add to 192.168.200.94/32 table admin

commit the changes:

ip route flush cache

DONE! enjoy! --Jason

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.