ifconfig.if(5) - NetBSD Manual Pages

Command: Section: Arch: Collection:  
IFCONFIG.IF(5)            NetBSD File Formats Manual            IFCONFIG.IF(5)

ifconfig.if -- interface-specific configuration files or variables
The ifconfig.if files or variables contain information regarding the con- figuration of each network interface. ifconfig.if is processed by /etc/rc.d/network at system boot time. For each interface (nnX) that is to be configured, there should be either an ifconfig_nnX variable in rc.conf(5), or an /etc/ifconfig.nnX file (such as the ifconfig_fxp0 variable or the /etc/ifconfig.fxp0 file for the fxp0 interface). The variable or file will get evaluated only if the interface exists on the system. Multiple lines can be placed in a vari- able or file, and will be evaluated sequentially. In the case of a vari- able, semicolons may be used instead of newlines, as described in rc.conf(5). Normally, a line will be evaluated as command line arguments to ifconfig(8). ``ifconfig nnX'' will be prepended on evaluation. Argu- ments with embedded shell metacharacters should be quoted in sh(1) style. If the line is equal to ``dhcp'', dhcpcd(8) will be started for the interface. 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 but may not be modified. 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 netmask media 100baseTX inet netmask alias # let us have IPv6 address on this interface inet6 2001:db8::1 prefixlen 64 alias # have subnet router anycast address too inet6 2001:db8:: 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 sets a network name for a wireless interface (using quotes to protect special characters in the name), and starts dhcpcd(8): ssid 'my network' dhcp The following example is for dynamically-created pseudo interfaces like gif(4). Earlier versions of /etc/rc.d/network required an explicit `create' command for such interfaces, but creation is now handled auto- matically. up # configure IPv6 default route toward the interface !route add -inet6 default ::1 !route change -inet6 default -ifp $int
rc.conf(5), ifconfig(8) NetBSD 5.0.1 January 9, 2009 NetBSD 5.0.1
Powered by man-cgi (2021-06-01). Maintained for NetBSD by Kimmo Suominen. Based on man-cgi by Panagiotis Christias.