bin/76305: dhclient resets configured interfaces on startup
norgaard at locolomo.org
Sun Jan 16 05:50:28 PST 2005
>Synopsis: dhclient resets configured interfaces on startup
>Arrival-Date: Sun Jan 16 13:50:20 GMT 2005
>Originator: Erik Norgaard
FreeBSD charm.daemonsecurity.com 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Thu Jan 13 10:10:51 CET 2005 norgaard at charm.daemonsecurity.com:/usr/obj/usr/src/sys/CURRENT i386
This problem report mentions two problems, I believe them to be sufficiently related that they can go in one report.
On startup, dhclient will reset (ie set ip to 0.0.0.0) the interface regardless if it has been previously configured (ie by bootp at boot). If starting up dhclient for one interface, any other interface previously configured with dhclient will be reset.
The -n option (do not configure any interface) does not work (it works like -nw, become daemon emidiately).
The consequenses are that you cannot configure two interfaces with dhclient separately, this is most likely because dhclient uses only one lease file, rather than one per interface.
It only makes sense to reset interfaces if there are conflicts, ie. coinciding network addresses, but then the second interface configuration should fail.
For diskless clients with interface configured at boot, the diskless client will loose contact with the nfs server when the interface is reset and hang.
It is not clear to me if the problem is that dhclient attempts to write the lease file on the nfs-mounted /var share before configuring the interface.
The description provided in the handbook on how to setup diskless clients won't work since one cannot get hold of the swap options, or other user specified dhcp options - this could be documentation that needs update though.
If dhclient is starting up for one interface, any other interface should be left as is regardless of how it has been configured. This could be solved by using one leasefile per interface.
The startup of dhclient should fail if the dhcp offer is an address on a previously configured network on a different interface.
If dhclient is started with -n option and the interface is configured, the request sent should be for lease renewal rather than for a new lease.
a) Host with two interfaces (eg xl0 and xl1), try start dhclient as follows:
# dhclient xl0
# dhclient xl1
keep an eye on how interfaces are configured with ifconfig. The second dhclient will fail and exit silently after having reset xl0, the first dhclient will be unable to reconfigure xl0 - a restart is needed.
b) diskless setup, let the host start dhclient on boot.
Note: on freebsd 5.3 the diskless client can use memory filesystems for /var, I haven't tried if this solves the problem, however this is only a viable solution if the host has enough ram.
More information about the freebsd-bugs