FreeBSD 8.0 problems with interface renaming and dhcp?

Brooks Davis brooks at
Fri Dec 4 22:51:41 UTC 2009

On Fri, Dec 04, 2009 at 07:43:17PM +0100, Angelo Hongens wrote:
> On most of my BSD machines I rename the interfaces to nic0. This way, I
> can swap cards and drivers, and keep the rest of my config the same.
> I upgraded one of these machines from 7.2 to 8.0 (both standard kernel),
> and suddenly the machine would not get a dhcp lease.
> In my /etc/rc.conf:
> ifconfig_em0_name="nic0"
> ifconfig_nic0="DHCP"
> The machine woud boot, but not get an ip. (and no dhclient output while
> booting). And ifconfig would show the nic nic0 up, but without an ip. If
> I do 'dhclient nic0' it immediately gets an ip, and all is well.
> If I do NOT rename the interface but just config: ifconfig_em0="DHCP"
> everything works as well..
> So is this a new bug or feature introduced in FreeBSD8? Is it something
> that can be fixed? (So dhclient is executed for renamed interfaces.)

I think the problem here is that with the new DHCP configuration where
we only start DHCP based on link events we're loosing a race between the
link coming up and the rename occurring.  The absolutely correct answer is
that the nic should no be trying to do anything until it is configured
up and I don't think that happens before the rename (it shouldn't).
It's likely the case though that a number of nics incorrectly start doing
things before they are configured and thus racing the rename.  The
easiest workaround in the rc.d code would probably be to add some code
to the rename section to take the interface down and then bring it back
up after the rename.  That should cause it to renegotiate and generate
an event.

The no code change workaround is to change DHCP to SYNCDHCP which will
restore the old behavior on this interface.

-- Brooks
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url :

More information about the freebsd-current mailing list