xref: /openbsd-src/share/man/man4/trunk.4 (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1.\"	$OpenBSD: trunk.4,v 1.29 2015/03/13 19:58:41 jmc Exp $
2.\"
3.\" Copyright (c) 2005, 2006 Reyk Floeter <reyk@openbsd.org>
4.\"
5.\" Permission to use, copy, modify, and distribute this software for any
6.\" purpose with or without fee is hereby granted, provided that the above
7.\" copyright notice and this permission notice appear in all copies.
8.\"
9.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
10.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
11.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
12.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
13.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
14.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
15.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
16.\"
17.Dd $Mdocdate: March 13 2015 $
18.Dt TRUNK 4
19.Os
20.Sh NAME
21.Nm trunk
22.Nd link aggregation and link failover interface
23.Sh SYNOPSIS
24.Cd "pseudo-device trunk"
25.Sh DESCRIPTION
26The
27.Nm
28interface allows aggregation of multiple network interfaces as one virtual
29.Nm
30interface.
31.Pp
32A
33.Nm
34interface can be created using the
35.Ic ifconfig trunk Ns Ar N Ic create
36command.
37It can use different link aggregation protocols specified
38using the
39.Ic trunkproto Ar proto
40option.
41Child interfaces can be added using the
42.Ic trunkport Ar child-iface
43option and removed using the
44.Ic -trunkport Ar child-iface
45option.
46.Pp
47The driver currently supports the trunk protocols
48.Ic broadcast ,
49.Ic failover ,
50.Ic lacp ,
51.Ic loadbalance ,
52.Ic none ,
53and
54.Ic roundrobin
55(the default).
56The protocols determine which ports are used for outgoing traffic
57and whether a specific port accepts incoming traffic.
58The interface link state is used to validate if the port is active or
59not.
60.Bl -tag -width loadbalance
61.It Ic broadcast
62Sends frames to all ports of the trunk and receives frames on any
63port of the trunk.
64.It Ic failover
65Sends and receives traffic only through the master port.
66If the master port becomes unavailable,
67the next active port is used.
68The first interface added is the master port;
69any interfaces added after that are used as failover devices.
70.It Ic lacp
71Uses the IEEE 802.3ad Link Aggregation Control Protocol (LACP)
72and the Marker Protocol
73to increase link speed and provide redundancy.
74LACP trunk groups are composed of ports of the same speed,
75set to full-duplex operation.
76This protocol requires a switch which supports LACP.
77.It Ic loadbalance
78Distributes outgoing traffic through all active ports
79and accepts incoming traffic from any active port.
80A hash of the protocol header is used to maintain packet ordering.
81The hash includes the Ethernet source and destination address and, if
82available, the VLAN tag, and the IP source and destination address.
83.It Ic none
84This protocol is intended to do nothing: it disables any traffic without
85disabling the
86.Nm
87interface itself.
88.It Ic roundrobin
89Distributes outgoing traffic through all active ports
90and accepts incoming traffic from any active port.
91A round-robin scheduler is used to aggregate the traffic.
92.El
93.Pp
94The configuration can be done at runtime or by setting up a
95.Xr hostname.if 5
96configuration file for
97.Xr netstart 8 .
98.Sh EXAMPLES
99Create a simple round robin trunk with two
100.Xr bge 4
101Gigabit Ethernet
102interfaces:
103.Bd -literal -offset indent
104# ifconfig bge0 up
105# ifconfig bge1 up
106# ifconfig trunk0 trunkport bge0 trunkport bge1 \e
107	192.168.1.1 netmask 255.255.255.0
108.Ed
109.Pp
110The following example uses an active failover trunk to set up roaming
111between wired and wireless networks using two network devices.
112Whenever the wired master interface is unplugged, the wireless failover
113device will be used:
114.Bd -literal -offset indent
115# ifconfig em0 up
116# ifconfig ath0 nwid my_net up
117# ifconfig trunk0 trunkproto failover trunkport em0 trunkport ath0 \e
118	192.168.1.1 netmask 255.255.255.0
119.Ed
120.Sh SEE ALSO
121.Xr inet 4 ,
122.Xr hostname.if 5 ,
123.Xr ifconfig 8 ,
124.Xr netstart 8
125.Sh HISTORY
126The
127.Nm
128device first appeared in
129.Ox 3.8 .
130.Sh AUTHORS
131The
132.Nm
133driver was written by
134.An Reyk Floeter Aq Mt reyk@openbsd.org .
135.Sh CAVEATS
136The trunk protocols
137.Ic loadbalance
138and
139.Ic roundrobin
140require a switch which supports IEEE 802.3ad static link aggregation;
141otherwise protocols
142such as
143.Xr inet6 4
144duplicate address detection (DAD)
145cannot properly deal with duplicate packets.
146.Pp
147There is no way to configure LACP administrative variables, including
148system and port priorities.
149The current implementation always performs active-mode LACP and uses
1500x8000 as system and port priorities.
151.Pp
152The
153.Nm
154interface takes its MTU from the first
155.Ic trunkport .
156To avoid mismatches, adding a child interface with a different
157MTU is not permitted.
158