a /etc/rc.d/network at system boot time.
p One file should exist for each interface that is to be configured, such as
a /etc/ifconfig.fxp0 . The file will get evaluated only if the interface exists on the system. Multiple lines can be placed in a file, and will be evaluated sequentially.
p Normally, a line will be evaluated as command line arguments to .Xr ifconfig 8 . .Dq Li ifconfig if will be prepended on evaluation.
p If a line is empty, or starts with .Sq # , the line will be ignored as comment.
p If a line starts with .Sq ! , the rest of line will get evaluated as shell script fragment. Shell variables declared in
a /etc/rc.d/network are accessible. The most useful variable is .Li $int , as it will be bound to the interface being configured with the file.
p For example, the following illustrates static interface configuration: d -literal -offset indent # IPv4, with an alias inet 10.0.1.12 netmask 255.255.255.0 media 100baseTX inet 10.0.1.13 netmask 255.255.255.255 alias # let us have IPv6 address on this interface inet6 fec0::1 prefixlen 64 alias # have subnet router anycast address too inet6 fec0:: prefixlen 64 alias anycast .Ed
p The following illustrates dynamic configuration setup with .Xr dhclient 8 and .Xr rtsol 8 : d -literal -offset indent up # autoconfigure IPv4 address !dhclient $int # autoconfigure IPv6 address. be sure to set $ip6mode to autohost. !rtsol $int .Ed
p The following example is for dynamically-created pseudo interfaces like .Xr gif 4 : d -literal -offset indent up # configure IPv6 default route toward the interface !route add -inet6 default ::1 !route change -inet6 default -ifp $int .Ed
p Earlier versions of
a /etc/rc.d/network required an explicit .Sq create command for such interfaces. This is now handled automatically. .Sh FILES
a /etc/rc.d/network .Sh SEE ALSO .Xr rc.conf 5 , .Xr ifconfig 8