Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I recently setup a linux box running Ubuntu 8.04 (to match another server with 8.04). I need to insure that this box has a static IP address and I changed /etc/network/interfaces to set up the static IP address and when I run sudo /etc/init.d/networking restart it works fine for a while, but always reverts back to 10.0.1.24 after being idle for a while.

I also tried stopping/removing the dhcp client, but that didn't help.

sudo /etc/init.d/dhcp stop
sudo apt-get remove dhcp3-client

Here is my /etc/init.d/networking:

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
    address 10.0.1.4
    netmask 255.255.255.0
    broadcast 10.0.1.255
    gateway 10.0.1.1

Any thoughts?

share|improve this question

2 Answers 2

The GNOME NetworkManager is what I suspect. I've always had to reboot to stop NetworkManager reverting the interface, but I suspect it is caching the information somewhere. At least try stopping and starting NetManager service first (/etc/init.d/network-manager stop|start).

You may want to ifdown eth0 the interface before restarting network manager, but I'm not sure if that helps or hinders.

share|improve this answer

you need to edit /etc/hosts and make it look like this

127.0.0.1       localhost.localdomain   localhost
10.0.1.4        server1.example.com     server1
# The following lines are desirable for IPv6 capable hosts
::1     ip6-localhost ip6-loopback
fe00::0 ip6-localnet
ff00::0 ip6-mcastprefix
ff02::1 ip6-allnodes
ff02::2 ip6-allrouters
ff02::3 ip6-allhosts

More info for you on this page.

share|improve this answer
1  
That only determines host name resolution, not what IP address he gets. –  Peter Eisentraut Jan 22 '10 at 6:53

Your Answer

 
discard

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