By default, BSD/OS configures all its networking interfaces while
it it running the /etc/netstart file, during the reboot
process. Right after this script finishes, the network is assumed to
be configured and accessible. The network is almost
certainly configured, but is often not quite accessible --
auto-negotiation by ethernet switches often takes tens of seconds to
complete. This presents a problem for the programs that want to
access the network and run immediately after
/etc/netstart.
A small change to /etc/netstart will delay the script
from finishing until the default router is reachable over the
network. The downside of the change is that if the default router
never becomes reachable, the machine never finishes rebooting,
either!
# BEGIN LOCAL ADDITIONS
# Wait to make sure the ethernet switch has sync'ed up with us...
if [ "X${defroute}" != X ]; then
router=${defroute%% *}
echo -n 'Waiting for default router ('${router}') '
while ! ping -n -c 1 $router >/dev/null 2>&1; do
echo -n '.'
done
echo ' done!'
fi
The above code fragment, when inserted into /etc/netstart will delay the machine until the default router becomes available.
Back to the page of Not So Frequently Asked Questions.