dhcp broadcasts send even if IP is static

Soren Hansen soren at ubuntu.com
Thu Aug 2 10:02:04 UTC 2007


On Thu, Aug 02, 2007 at 11:55:31AM +0200, Ingo Lantschner wrote:
> Hi, I am running some Ubuntu 6.06 Servers as VMs in VMware. I often
> change their IP-addresses from DHCP to static by editing the /etc/
> network/interfaces. After # /etc/init.d/networking restart they get
> the static IP-address but still send broadcasts to DHCP-servers.
> After a reboot of the whole machine these broadcasts are stopped.

This happens because you change your interfaces file first and then run
ifdown. At that point, ifdown doesn't know that it has a dhclient
running and hence doesn't stop it.

What you probably want to do is put something like this into your
interfaces file:

iface dyn inet dhcp

iface stat inet static
	address 10.0.0.1
	blahblah

When you want to bring up eth0 with dhcp, you do "ifup eth0=dyn", and
when you want it statically configured, you do "ifup eth0=stat". That
way you don't have to change your interfaces file every time. See the
interfaces(5) man page for more info.

-- 
Soren Hansen
Ubuntu Server Team
http://www.ubuntu.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <https://lists.ubuntu.com/archives/ubuntu-server/attachments/20070802/81843d12/attachment.pgp>


More information about the ubuntu-server mailing list