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 have a home server set up as my internet gateway. IP fowarding and such is working fine, but for some reason the server keeps grabbing a DHCP address instead of sticking with the static address I have set up in /etc/network/interfaces. eth1 keeps switching over to a DHCP address (sort of oddly.. assigned by the DHCP server running on itself).

My first thought was Network Manager, but it doesn't seem to be installed.

Here's my interfaces file:

# The loopback network interface
auto lo
iface lo inet loopback

# External interface to the outside world
auto eth0
iface eth0 inet dhcp
    pre-up iptables-restore < /etc/iptables.rules

# Our local network, we're the DHCP server
auto eth1
iface eth1 inet static
    address   192.168.1.1
    netmask   255.255.255.0
    network   192.168.1.0
    broadcast 192.168.1.255

Are there any other utilities installed by default that might be resetting the network interface?

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Turns out this was a simple not having rebooted problem.

I had changed my /etc/network/interfaces to set the static interface, but never rebooted. This left dhclient running for eth1, which eventually went to renew the DHCP address. Killing dhclient fixed the problem, and with the interfaces file defining a static IP, it was not started on the next reboot.

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.