unixdev.net


Switch to SpeakEasy.net DSL

The Modular Manual Browser

Home Page
Manual: (OpenBSD-3.6)
Page:
Section:
Apropos / Subsearch:
optional field

HOSTNAME.IF(5)            OpenBSD Programmer's Manual           HOSTNAME.IF(5)

NAME
     hostname.if, bridgename.if - interface-specific configuration files

DESCRIPTION
     The hostname.* and bridgename.* files contain information regarding the
     configuration of each network interface.  One file should exist for each
     interface that is to be configured, such as hostname.fxp0 or
     bridgename.bridge0.  However, a configuration file is not needed for lo0.
     Note that multiple entries can be used per configuration file.

     The following three formats are valid for hostname.* files:

     Regular ipv4 network setup:

           addr_family [alias] addr netmask broadcast_addr options
           dest dest_addr

     Regular ipv6 network setup:

           addr_family [alias] addr prefixlen options

     Other network setup:

           addr_family options

     A typical file contains only one line, but more extensive files are pos-
     sible, for example:

      inet 10.0.1.12 255.255.255.0 10.0.1.255 media 100baseTX description Uplink
      inet alias 10.0.1.13 255.255.255.255 10.0.1.13
      inet alias 10.0.1.14 255.255.255.255 NONE
      inet alias 10.0.1.15 255.255.255.255
      inet alias 10.0.1.16 0xffffffff
      inet6 alias fec0::1 64
      inet6 alias fec0::2 64 anycast
      # This is an example comment line.
      !wicontrol \$if -t 2  # Set to 2Mbps

     The above formats have the following field values:

           addr_family
                   The address family of the interface, generally ``inet'' or
                   ``inet6''.

           addr    The optional address that belongs to the interface, such as
                   190.191.192.1 or fe80:2::1.  It is also feasible to use a
                   hostname as specified in /etc/hosts.  It is recommended
                   that an address be used instead of symbolic information,
                   since the latter might activate resolver(3) library rou-
                   tines.

                   If no address is specified, the netmask, broadcast_addr,
                   dest, and dest_addr options are invalid and will be ig-
                   nored.

           netmask
                   The optional network mask for the interface, i.e.,
                   255.255.255.0.

           broadcast_addr
                   The optional broadcast address for the interface, i.e.,
                   190.191.192.255

           options
                   Optional miscellaneous options to set on the interface,
                   i.e., ``media 100baseTX mediaopt full-duplex''.

           dest    If the interface needs a destination address set, this is
                   the literal text ``dest''.  As shown in the example, this
                   declaration should start on a separate line.

           dest_addr
                   The destination address to be set on the interface, such as
                   190.191.192.2.  It is also feasible to use a hostname as
                   specified in /etc/hosts.  It is recommended that an address
                   be used instead of symbolic information which might acti-
                   vate resolver(3) library routines.

           prefixlen
                   The prefixlen number, or number of bits in the netmask, to
                   be set on the interface, such as 64.

           #       Comments are allowed.  Anything following a comment charac-
                   ter is treated as a comment.

           !command-line
                   Arbitrary shell commands can be executed using this direc-
                   tive.  Useful for doing interface specific configuration
                   using commands like wicontrol(8), setting up custom routes
                   using route(8), or establishing tunnels using ifconfig(8).
                   It is worth noting that ``\$if'' in a command line will be
                   replaced by the interface name.

     A DHCP-configured network interface setup consists of

           dhcp options

     For example:

           dhcp media 100baseTX mediaopt full-duplex

     The above format has the following field values:

           dhcp    The literal string ``dhcp'' if the interface is to be con-
                   figured using DHCP.  See dhclient(8) and dhclient.conf(5)
                   for more details.

           options
                   Optional miscellaneous options to set on the interface,
                   i.e., ``media 100baseTX mediaopt full-duplex''.

     IPv6 stateless address autoconfiguration:

           rtsol options

     The above format has the following field values:

           rtsol   The literal string ``rtsol'' if the interface is to be con-
                   figured using IPv6 stateless address autoconfiguration.
                   This should be used on single interface hosts only, since
                   the IPv6 specifications are silent about the behavior on
                   multi-interface hosts.  Also note that the kernel must be
                   configured to accept IPv6 router advertisement, and config-
                   ured as a host (ie. non-router).  Add the following lines
                   into sysctl.conf(5):

                         net.inet6.ip6.forwarding=0
                         net.inet6.ip6.accept_rtadv=1

           options
                   Optional miscellaneous options to set on the interface,
                   e.g., ``media 100baseTX mediaopt full-duplex''.

     An addressless network interface setup (useful for bridge(4) member in-
     terfaces and interfaces to be used with ppp(8) and pppoe(8)) consists of

           up options

     The above format has the following field values:

           up      The literal string ``up'' if the interface is to be simply
                   brought up.

           options
                   Optional miscellaneous options to set on the interface,
                   e.g., ``media 100baseTX mediaopt full-duplex''.

     The final file format only applies to bridgename.bridge* files.  A bridge
     interface setup consists of

           brconfig-arguments
           brconfig-arguments
           ...

     For example:

           add fxp0
           add ep1
           -learn fxp0
           #
           !ipsecadm flush
           #
           static fxp0 8:0:20:1e:2f:2b
           up    # and finally enable it

     The options are as follows:

           brconfig-arguments
                   brconfig(8) is called for each successive line.  Comments
                   starting with `#' and commands to be executed prefixed by
                   `!' are permitted.

SEE ALSO
     hosts(5), ancontrol(8), brconfig(8), dhcp(8), ifconfig(8), lmccontrol(8),
     netstart(8), rc(8), spppcontrol(8), wicontrol(8)

OpenBSD 3.6                    September 2, 1999                             3