Solved FreeBSD 14 /etc/rc.conf.d

Hello.
I want to move the IP alias setting from /etc/rc.conf to /etc/rc.conf.d/net.
Code:
ifconfig_ix0="inet 1.2.2.2 netmask 255.255.255.0"
ifconfig_ix0_alias0="inet ....."
It doesn't work.
Network is down.
 
rc.conf(5)
In addition to /etc/rc.conf.local you can also place smaller
configuration files for each rc(8) script in the /etc/rc.conf.d directory
or <dir>/rc.conf.d directories specified in local_startup, which will be
included by the load_rc_config function.

*did* you specify that directory in local_startup? By default only /usr/local/etc/rc.d is set:
Code:
$ grep local_startup /etc/defaults/rc.conf
local_startup="/usr/local/etc/rc.d" # startup script dirs.

Also your ifconfig_ix0 line is missing the "up" statement.
 
Here (/usr/local/etc/rc.d) there should be startup scripts, but not system parameters.
 
What's worth confirming would be...
  • What does ifconfig without options/operands show? Does ix0 appears properly there?
  • Does service netif restart ix0 helps?
 
Never tried it but it might work if you name the file /etc/rc.conf.d/netif as it's the netif 'service' that sets the IP addresses. As far as I know the rc.conf.d file needs to be named the same as the service it applies to.
Ah, so knowledge of each rc.d scripts is required for fine-grained configuration, then.

And proper part of rc.conf(5) would be
For jail configurations you could use the file /etc/rc.conf.d/jail to store jail-specific configuration options.
where "For jail" here means "For /etc/rc.d/jail".
 
Never tried it but it might work if you name the file /etc/rc.conf.d/netif as it's the netif 'service' that sets the IP addresses. As far as I know the rc.conf.d file needs to be named the same as the service it applies to.
You are right, thank you.
 
Back
Top