Netwait on FreeBSD

I’m sure your server is running at least one service which needs network. Once in awhile happens that the server will start all, or at least is trying to start all services but the network is not ready yet. In this situation services pending on the network will fail.
The solution is netwait. As the name says this will hold on starting services until the network is ready.

Here is an example how to use it. Add to your /etc/rc.conf | /etc/rc.conf.local the following lines:

    1. netwait_enable="YES"
    2. netwait_timeout="60"
    3. netwait_ip=""

1. Enable the service
2. Timeout in seconds
3. IP the be pinged, I use the default gateway

Here is the full list

### Network link/usability verification options
netwait_enable="YES"		# Enable rc.d/netwait (or NO)
netwait_ip=""			# IP addresses to be pinged by netwait.
netwait_timeout="60"		# Total number of seconds to perform pings.
netwait_if=""			# Interface name to watch link state on.
netwait_if_timeout="30"		# Total number of seconds to monitor link state.

Source and more information can be found here.

One thought on “Netwait on FreeBSD”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.