Where is debian storing its network settings?

1

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
  address   192.168.1.99
  gateway   192.168.1.1
  netmask   255.255.255.0
  network   192.168.1.0
  broadcast 192.168.1.255

Yet

$> 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:192.168.1.205  Bcast:255.255.255.255  Mask:255.255.255.0
...

Where is it being told to use dhcp?

user13743

Posted 2010-04-07T17:46:18.533

Reputation: 1 571

Answers

1

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

user13743

Posted 2010-04-07T17:46:18.533

Reputation: 1 571

2killall 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 – 2010-04-07T18:41:03.150

0

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.

LawrenceC

Posted 2010-04-07T17:46:18.533

Reputation: 63 487