Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a debian machine that is supposed to have a static ip, but insists on getting its address from the DHCP server.

Here's this settings file:

$> cat /etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
allow-hotplug eth0
iface eth0 inet static


$> sudo /etc/init.d/networking restart
Reconfiguring network interfaces...done.
$> sudo ifconfig
eth0      Link encap:Ethernet  HWaddr 00:e0:03:09:05:2e
          inet addr:  Bcast:  Mask:

Where is it being told to use dhcp?

share|improve this question
up vote 1 down vote accepted

Well, apparently a complete restart fixed it. so much for Linux not needed restarts on settings changes! :P

share|improve this answer
killall dhclient would probably done the same thing. Or stop, followed by editing the file, followed by start. It only stops the dhcp client process if the interface is set to use dhcp, so a restart does not kill dhcp, if the interface is not set to use dhcp. – Justin Smith Apr 7 '10 at 18:41
Ah. Thanks much! Put that as an answer and I'll upvote and accept it :) – user13743 Apr 7 '10 at 20:41

To actually answer your question, you have the right file.

This stanza:

iface eth0 inet static

is what controls whether a static IP is assigned on boot or if it tries to use DHCP. To use DHCP, change to:

iface eth0 inet dhcp

man interfaces will tell you more.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .