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 use Ubuntu, and I have many interfaces. eth0, which is my internet connection, and it gets its info from a DHCP-server totally outside of my control.

I then have eth1,eth2,eth3 and eth4 which I have created a DHCP-server for.(ISC DHCP-Server)

It seems to work, and I even get an IP-address from the foreign DHCP-server on the internet facing interface.

However, for some reason it seems my gateway for eth0 became screwed after I installed my local DHCP-server for eth1-eth4. (I think so because I got an IP for eth0, and I can ping other stuff on the local network, but I cannot get access to the internet).

My eth0-specific info in /etc/network/interfaces:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

auto eth1
iface eth1 inet static
  mtu 8192

auto eth2
iface eth2 inet static
  mtu 8192

My /etc/default/isc-dhcp-server:

INTERFACES="eth1 eth2 eth3 eth4"

So why does my local DHCP-server mess up the gateway for eth0, when I tell it not to listen to eth0? Anyone see the problem or what I can do to fix it?

The problem seems indeed to be the gateways. netstat -nr gives: --- 10.X.X.X ---- --- UG 0 0 0 eth3

It should have been 129.2XX.X.X UG 0 0 0 eth0

So for some reason, my local DHCP-server overrides the gateway I get from the network DHCP.

Edit: dhcp.conf looks like this(I included info only for eth1 subnet):

ddns-update-style none;

not authoritative;

subnet netmask { interface eth1; 
option domain-name "example.org"; 
option domain-name-servers ns1.example.org, 
default-lease-time 600; 
max-lease-time 7200;
host camera1_1 { hardware ethernet 00:30:53:11:24:6E; fixed-address; }
host camera2_1 { hardware ethernet 00:30:53:10:16:70; fixed-address; } 

Also, it seems that the gateway is correctly set if I run /etc/init.d/networking restart in a terminal, but that's not helpful for me, I need the correct gateway to be set during startup, and I'd rather find the source of the problem

share|improve this question
There is no such thing as a default gateway for eth0, default gateways are system-wide. Can you post your dhcp configuration file?. –  Javier Rivera Oct 16 '12 at 15:02
Added it now. I only added part of the file(Only one subnet for eth1)..the other are pretty much the same –  Henrik Alstad Oct 16 '12 at 15:30
add comment

1 Answer 1

I'm hardly any kind of expert on this subject, but I suspect that because of the broadcast nature of DHCP packets, your local DHCP server is always going to answer locally originating requests regardless of the listening interfaces that you configured.

So I would suggest you try simply setting "reject" statements in your dhclient.conf to reject offers from the local server:


(I'm only guessing that you can use multiple reject statements, man page is unclear.)

I can think of some other things to try also, but I might be wrong in my initial assumption anyway. I always find this a useful tool to diagnose what is happening:

apt-get install dhcpdump
dhcpdump -i eth1

PS: If you want to keep eth0, eth1, eth2 etc. properly separated, consider using VLANs to isolate traffic at layer 2.

share|improve this answer
add comment

Your Answer


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.