]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/man/man4/lagg.4
Remove deprecated GEOM classes
[FreeBSD/FreeBSD.git] / share / man / man4 / lagg.4
1 .\"     $OpenBSD: trunk.4,v 1.18 2006/06/09 13:53:34 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 .\" $FreeBSD$
18 .\"
19 .Dd November 18, 2017
20 .Dt LAGG 4
21 .Os
22 .Sh NAME
23 .Nm lagg
24 .Nd link aggregation and link failover interface
25 .Sh SYNOPSIS
26 To compile this driver into the kernel,
27 place the following line in your
28 kernel configuration file:
29 .Bd -ragged -offset indent
30 .Cd "device lagg"
31 .Ed
32 .Pp
33 Alternatively, to load the driver as a
34 module at boot time, place the following line in
35 .Xr loader.conf 5 :
36 .Bd -literal -offset indent
37 if_lagg_load="YES"
38 .Ed
39 .Sh DESCRIPTION
40 The
41 .Nm
42 interface allows aggregation of multiple network interfaces as one virtual
43 .Nm
44 interface for the purpose of providing fault-tolerance and high-speed links.
45 .Pp
46 A
47 .Nm
48 interface can be created using the
49 .Ic ifconfig lagg Ns Ar N Ic create
50 command.
51 It can use different link aggregation protocols specified
52 using the
53 .Ic laggproto Ar proto
54 option.
55 Child interfaces can be added using the
56 .Ic laggport Ar child-iface
57 option and removed using the
58 .Ic -laggport Ar child-iface
59 option.
60 .Pp
61 The driver currently supports the aggregation protocols
62 .Ic failover
63 (the default),
64 .Ic lacp ,
65 .Ic loadbalance ,
66 .Ic roundrobin ,
67 .Ic broadcast ,
68 and
69 .Ic none .
70 The protocols determine which ports are used for outgoing traffic
71 and whether a specific port accepts incoming traffic.
72 The interface link state is used to validate if the port is active or
73 not.
74 .Bl -tag -width loadbalance
75 .It Ic failover
76 Sends traffic only through the active port.
77 If the master port becomes unavailable,
78 the next active port is used.
79 The first interface added is the master port;
80 any interfaces added after that are used as failover devices.
81 .Pp
82 By default, received traffic is only accepted when they are received
83 through the active port.
84 This constraint can be relaxed by setting the
85 .Va net.link.lagg.failover_rx_all
86 .Xr sysctl 8
87 variable to a nonzero value,
88 which is useful for certain bridged network setups.
89 .It Ic lacp
90 Supports the IEEE 802.1AX (formerly 802.3ad) Link Aggregation Control Protocol
91 (LACP) and the Marker Protocol.
92 LACP will negotiate a set of aggregable links with the peer in to one or more
93 Link Aggregated Groups.
94 Each LAG is composed of ports of the same speed, set to full-duplex operation.
95 The traffic will be balanced across the ports in the LAG with the greatest
96 total speed, in most cases there will only be one LAG which contains all ports.
97 In the event of changes in physical connectivity, Link Aggregation will quickly
98 converge to a new configuration.
99 .It Ic loadbalance
100 Balances outgoing traffic across the active ports based on hashed
101 protocol header information and accepts incoming traffic from
102 any active port.
103 This is a static setup and does not negotiate aggregation with the peer or
104 exchange frames to monitor the link.
105 The hash includes the Ethernet source and destination address, and, if
106 available, the VLAN tag, and the IP source and destination address.
107 .It Ic roundrobin
108 Distributes outgoing traffic using a round-robin scheduler
109 through all active ports and accepts incoming traffic from
110 any active port.
111 Using
112 .Ic roundrobin
113 mode can cause unordered packet arrival at the client.
114 Throughput might be limited as the client performs CPU-intensive packet
115 reordering.
116 .It Ic broadcast
117 Sends frames to all ports of the LAG and receives frames on
118 any port of the LAG.
119 .It Ic none
120 This protocol is intended to do nothing: it disables any traffic without
121 disabling the
122 .Nm
123 interface itself.
124 .El
125 .Pp
126 Each
127 .Nm
128 interface is created at runtime using interface cloning.
129 This is
130 most easily done with the
131 .Xr ifconfig 8
132 .Cm create
133 command or using the
134 .Va cloned_interfaces
135 variable in
136 .Xr rc.conf 5 .
137 .Pp
138 The MTU of the first interface to be added is used as the lagg MTU.
139 All additional interfaces are required to have exactly the same value.
140 .Pp
141 The
142 .Ic loadbalance
143 and
144 .Ic lacp
145 modes will use the RSS hash from the network card if available to avoid
146 computing one, this may give poor traffic distribution if the hash is invalid
147 or uses less of the protocol header information.
148 Local hash computation can be forced per interface by setting the
149 .Cm -use_flowid
150 .Xr ifconfig 8
151 flag.
152 The default for new interfaces is set via the
153 .Va net.link.lagg.default_use_flowid
154 .Xr sysctl 8 .
155 .Sh EXAMPLES
156 Create a link aggregation using LACP with two
157 .Xr bge 4
158 Gigabit Ethernet interfaces:
159 .Bd -literal -offset indent
160 # ifconfig bge0 up
161 # ifconfig bge1 up
162 # ifconfig lagg0 create
163 # ifconfig lagg0 laggproto lacp laggport bge0 laggport bge1 \e
164         192.168.1.1 netmask 255.255.255.0
165 .Ed
166 .Pp
167 Create a link aggregation using ROUNDROBIN with two
168 .Xr bge 4
169 Gigabit Ethernet interfaces and set the limit of 500 packets
170 per interface:
171 .Bd -literal -offset indent
172 # ifconfig bge0 up
173 # ifconfig bge1 up
174 # ifconfig lagg0 create
175 # ifconfig lagg0 laggproto roundrobin laggport bge0 laggport bge1 \e
176         192.168.1.1 netmask 255.255.255.0
177 # ifconfig lagg0 rr_limit 500
178 .Ed
179 .Pp
180 The following example uses an active failover interface to set up roaming
181 between wired and wireless networks using two network devices.
182 Whenever the wired master interface is unplugged, the wireless failover
183 device will be used:
184 .Bd -literal -offset indent
185 # ifconfig em0 up
186 # ifconfig ath0 ether 00:11:22:33:44:55
187 # ifconfig create wlan0 wlandev ath0 ssid my_net up
188 # ifconfig lagg0 create
189 # ifconfig lagg0 laggproto failover laggport em0 laggport wlan0 \e
190         192.168.1.1 netmask 255.255.255.0
191 .Ed
192 .Pp
193 (Note the mac address of the wireless device is forced to match the wired
194 device as a workaround.)
195 .Sh SEE ALSO
196 .Xr ng_one2many 4 ,
197 .Xr ifconfig 8 ,
198 .Xr sysctl 8
199 .Sh HISTORY
200 The
201 .Nm
202 device first appeared in
203 .Fx 6.3 .
204 .Sh AUTHORS
205 .An -nosplit
206 The
207 .Nm
208 driver was written under the name
209 .Nm trunk
210 by
211 .An Reyk Floeter Aq Mt reyk@openbsd.org .
212 The LACP implementation was written by
213 .An YAMAMOTO Takashi
214 for
215 .Nx .
216 .Sh BUGS
217 There is no way to configure LACP administrative variables, including system
218 and port priorities.
219 The current implementation always performs active-mode LACP and uses 0x8000 as
220 system and port priorities.