2

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?

2 Answers 2

3

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.

-3

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.

1
  • 1
    That only determines host name resolution, not what IP address he gets. Jan 22, 2010 at 6:53

You must log in to answer this question.