TRUNK(4)                  OpenBSD Programmer's Manual                 TRUNK(4)

NAME
     trunk - link aggregation and link failover interface

SYNOPSIS
     pseudo-device trunk

DESCRIPTION
     The trunk interface allows aggregation of multiple network interfaces as
     one virtual trunk interface.

     A trunk interface can be created using the ifconfig trunkN create com-
     mand.  It can use different link aggregation protocols specified using
     the trunkproto proto option.  Child interfaces can be added using the
     trunkport child-iface option and removed using the -trunkport child-iface
     option.

     The driver currently supports the trunk protocols broadcast, failover,
     lacp, loadbalance, none, and roundrobin (the default).  The protocols de-
     termine which ports are used for outgoing traffic and whether a specific
     port accepts incoming traffic.  The interface link state is used to vali-
     date if the port is active or not.

     broadcast    Sends frames to all ports of the trunk and receives frames
                  on any port of the trunk.

     failover     Sends and receives traffic only through the master port.  If
                  the master port becomes unavailable, the next active port is
                  used.  The first interface added is the master port; any in-
                  terfaces added after that are used as failover devices.

     lacp         Uses the IEEE 802.3ad Link Aggregation Control Protocol
                  (LACP) and the Marker Protocol to increase link speed and
                  provide redundancy.  LACP trunk groups are composed of ports
                  of the same speed, set to full-duplex operation.  This pro-
                  tocol requires a switch which supports LACP.

     loadbalance  Distributes outgoing traffic through all active ports and
                  accepts incoming traffic from any active port.  A hash of
                  the protocol header is used to maintain packet ordering.
                  The hash includes the Ethernet source and destination ad-
                  dress, and, if available, the VLAN tag, and the IP source
                  and destination address.

     none         This protocol is intended to do nothing: it disables any
                  traffic without disabling the trunk interface itself.

     roundrobin   Distributes outgoing traffic through all active ports and
                  accepts incoming traffic from any active port.  A round-
                  robin scheduler is used to aggregate the traffic.

     The configuration can be done at runtime or by setting up a
     hostname.if(5) configuration file for netstart(8).

EXAMPLES
     Create a simple round robin trunk with two bge(4) Gigabit Ethernet inter-
     faces:

           # ifconfig bge0 up
           # ifconfig bge1 up
           # ifconfig trunk0 trunkport bge0 trunkport bge1 \
                   192.168.1.1 netmask 255.255.255.0

     The following example uses an active failover trunk to set up roaming be-
     tween wired and wireless networks using two network devices.  Whenever
     the wired master interface is unplugged, the wireless failover device
     will be used:

           # ifconfig em0 up
           # ifconfig ath0 nwid my_net up
           # ifconfig trunk0 trunkproto failover trunkport em0 trunkport ath0 \
                   192.168.1.1 netmask 255.255.255.0

SEE ALSO
     inet(4), hostname.if(5), ifconfig(8), netstart(8)

HISTORY
     The trunk device first appeared in OpenBSD 3.8.

AUTHORS
     The trunk driver was written by Reyk Floeter <reyk@openbsd.org>.

CAVEATS
     The trunk protocols loadbalance and roundrobin require a switch which
     supports IEEE 802.3ad static link aggregation; otherwise protocols such
     as inet6(4) duplicate address detection (DAD) cannot properly deal with
     duplicate packets.

     There is no way to configure LACP administrative variables, including
     system and port priorities.  The current implementation always performs
     active-mode LACP and uses 0x8000 as system and port priorities.

OpenBSD 4.7                    October 22, 2009                              2
