ifconfig.if(5) - NetBSD Manual Pages

IFCONFIG.IF(5)            NetBSD File Formats Manual            IFCONFIG.IF(5)


NAME
ifconfig.if -- interface-specific configuration files
DESCRIPTION
The ifconfig.if files contain information regarding the configuration of each network interface. ifconfig.if is processed by /etc/rc.d/network at system boot time. One file should exist for each interface that is to be configured, such as /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. Normally, a line will be evaluated as command line arguments to ifconfig(8). ``ifconfig if'' will be prepended on evaluation. If a line is empty, or starts with `#', the line will be ignored as com- ment. If a line starts with `!', the rest of line will get evaluated as shell script fragment. Shell variables declared in /etc/rc.d/network are accessible. The most useful variable is $int, as it will be bound to the interface being configured with the file. For example, the following illustrates static interface configuration: # 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 The following illustrates dynamic configuration setup with dhclient(8) and rtsol(8): up # autoconfigure IPv4 address !dhclient $int # autoconfigure IPv6 address. Be sure to set $ip6mode to autohost. !rtsol $int The following example is for dynamically-created pseudo interfaces like gif(4): up # configure IPv6 default route toward the interface !route add -inet6 default ::1 !route change -inet6 default -ifp $int Earlier versions of /etc/rc.d/network required an explicit `create' com- mand for such interfaces. This is now handled automatically.
FILES
/etc/rc.d/network
SEE ALSO
rc.conf(5), ifconfig(8) NetBSD 3.0.1 October 5, 2002 NetBSD 3.0.1

Powered by man-cgi (2024-08-26). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.