Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have two NICs in my server. One is connected to my cable modem/internet (eth0) and uses DHCP for configuration. The other is connected to a LAN (eth1) and has a static IP.

I have configured the server to provide DHCP and this works - machines added to the LAN get an IP address.

However, the server is unable to resolve web address when the LAN NIC is up. Doing:

sudo ifconfig eth1 down

the server can access the web (Firefox can load web pages). But if I do:

sudo ifconfig eth1 up

then the server can't access the internet (Firefox times out trying to load web pages).

Why is this happening?

EDIT: As reqested, the interfaces file:

auto eth0, eth1
mapping eth0 eth1
   script /etc/networks/get-mac-address.sh
   map 00:19:66:82:61:f7 internet
   map 00:27:19:b2:12:2b lan

iface internet inet dhcp
   gateway 192.168.1.2

iface lan inet static
   address 192.168.1.2
   network 192.168.1.0
   netmask 255.255.255.0
   broadcast 192.168.1.255
share|improve this question
add comment

2 Answers

It would be a lot easier if you included the contents of your /etc/network/interfaces file. If I where to guess, then I would think the most likely problem is that you have tried to set a default gateway on your secondary interface, and that network has a lower number.

Assuming a simple router the default gateway should only be defined on the interfaces that is connected to the Internet.

share|improve this answer
    
Have added the interfaces file, only one interface defines the gateway parameter. –  Skizz Jun 4 '10 at 23:38
    
Ok, now I am confused. What are you trying to do? Your DHCP interfaces is probably getting a gateway. You probably shouldn't be defining a default gateway at all. –  Zoredache Jun 5 '10 at 0:17
add comment

I don't see a gateway in your configuration. Try 'netstat -rn' to see if you have a gateway on eth1. The only routing for 0.0.0.0 should be on eth0. Check the contents of /etc/resolv.conf when eth1 is up and when it is down. They should be the same and have nameservers from your ISP listed. Try ping google.com with eth1 up and down. If it fails with eth1 up, try to ping by IP address. This will help determine if it is DNS or routing.

share|improve this answer
    
So, the gateway should be defined on the LAN connection, not the internet connection. That would actually make sense. –  Skizz Jun 5 '10 at 18:29
    
No the gateway is the gateway to the internet and needs to be on the internet connection. You want access to 0.0.0.0 on the internet side. –  BillThor Jun 5 '10 at 19:14
    
I managed to sort it all out - I think NetworkManager was the problem. Configuring NetworkManager to reflect the interfaces file seems to fix the problem. –  Skizz Jun 7 '10 at 9:06
    
Network manager is confused by your use of mapping in your interfaces file. You don't need it for ubuntu. The interface names are persisted via /etc/udev/rules.d/70-persistent-net.rules. Using the interfaces in the iface lines should resolve the problem without network manager. You now have two tools configuring your interaces. –  BillThor Jun 7 '10 at 16:00
add comment

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.