Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 16 Jan 2005 13:46:10 GMT
From:      Erik Norgaard <norgaard@locolomo.org>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   bin/76305: dhclient resets configured interfaces on startup
Message-ID:  <200501161346.j0GDkAfS049750@www.freebsd.org>
Resent-Message-ID: <200501161350.j0GDoKpQ087762@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         76305
>Category:       bin
>Synopsis:       dhclient resets configured interfaces on startup
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sun Jan 16 13:50:20 GMT 2005
>Closed-Date:
>Last-Modified:
>Originator:     Erik Norgaard
>Release:        6.0-CURRENT
>Organization:
N/A
>Environment:
FreeBSD charm.daemonsecurity.com 6.0-CURRENT FreeBSD 6.0-CURRENT #1: Thu Jan 13 10:10:51 CET 2005 norgaard@charm.daemonsecurity.com:/usr/obj/usr/src/sys/CURRENT  i386

>Description:
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.

Desired operation: 

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.
>How-To-Repeat:
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.
>Fix:

>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200501161346.j0GDkAfS049750>