in reply to Dan Langille

@dvl I put these two lines in /etc/rc.conf.d/network

background_dhclient="YES"
ifconfig_DEFAULT="SYNCDHCP"

They don't get applied on startup of the jail. Not unless I put them in /etc/rc.conf.

Yes, ifconfig_DEFAULT is legit. I learned that recently. I don't know what release it was added, but it saves you from having to customize the interface name for every jail :) (or VM)

in reply to feld

Have you tried this file:

/etc/rc.conf.d/dhclient

I'm guessing based on this:

[23:41 gw01 dvl /etc] % sudo grep -r background * | grep dhclient
grep: motd: No such file or directory
defaults/rc.conf:background_dhclient="NO" # Start dhcp client in the background.
defaults/rc.conf:#background_dhclient_em0="YES" # Start dhcp client on em0 in the background.
rc.d/dhclient: background_dhclient=$(get_if_var $ifn background_dhclient_IF $background_dhclient)
rc.d/dhclient: if checkyesno background_dhclient; then

in reply to feld

bottom of /etc/rc.d/netif:

# Load the old "network" config file also for compatibility.
# This is needed for mfsBSD at least.
load_rc_config network
load_rc_config $name

the "legacy" network config is deprecated, you're supposed to put your ifconfig settings in /etc/rc.conf.d/netif. This works. But not with dhclient. Because /etc/rc.d/dhclient only has:

load_rc_config $name
load_rc_config network

it's missing:

load_rc_config netif

this is key.

So in conclusion, there is a change that needs to be made upstream. I'll submit the patch.

You can put dhclient-specific config settings into /etc/rc.d/dhclient if you want, but you can't put any of the ifconfig_* settings in there. You can, however, put all of your network settings right now into /etc/rc.conf.d/network

That's what's going on. Confusion about boundaries, which files are loaded for what purpose, and where these settings should really go.

Today: /etc/rc.conf.d/network is fine for all ifconfig and dhclient related settings

Future: /etc/rc.conf.d/netif is where they really should be

This entry was edited (1 week ago)