Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 29 Jun 2011 12:34:19 -0400
From:      Steve Polyack <korvus@comcast.net>
To:        User Questions <freebsd-questions@freebsd.org>,  freebsd-net@freebsd.org
Subject:   Question about NIC link state initialization
Message-ID:  <4E0B540B.3090400@comcast.net>

Next in thread | Raw E-Mail | Index | Archive | Help
I have a handful of systems running FreeBSD 8.1-RELEASE.  An occaisional 
fat-finger in /etc/fstab may cause one to end up in single-user mode 
from time to time.  This would normally not be a problem, but some of 
these systems have a LOM (lights-out management) controller which shares 
the system's on-board NICs.  This works great 99% of the time, but when 
the system drops out of init(8) and into single-user mode, the links on 
the interfaces never come up, and therefore the LOM becomes 
inaccessible.  Cue remote-hands at the facility to help us remedy the 
problem.

I've been playing around with this configuration on a local system, and 
I've noticed that once at a single-user shell, all one has to do is run 
ifconfig to cause the NIC's links to come up.  You don't even have to 
specify the interface, nor do you have to specify "up".  As soon as I 
hit enter, ifconfig prints the typical interface summary - intermingled 
in with this are the bold kernel log messages stating "bce0: link state 
changed to UP" and "bce1: link state changed to UP".

So, my question is - why do we have to run ifconfig(8) to bring the 
links up on the attached interfaces?  Shouldn't they come up after the 
driver discovers and initializes the devices?  Keep in mind that I don't 
even have to pass any arguments (such as "up") to ifconfig.  
Furthermore, the behavior is exactly the same for bce(4) and em(4).

Short of patching init(8) (or perhaps the NIC drivers?), I don't see 
another way for me to ensure the links come up even when the system 
drops into single-user mode on boot.

- Steve



Want to link to this message? Use this URL: <http://docs.FreeBSD.org/cgi/mid.cgi?4E0B540B.3090400>