1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
|
.\" $OpenBSD: trunk.4,v 1.7 2005/10/04 08:42:00 reyk Exp $
.\"
.\" Copyright (c) 2005 Reyk Floeter <reyk@vantronix.net>
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
.\" WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
.\" ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
.\" WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
.Dd May 5, 2005
.Dt TRUNK 4
.Os
.Sh NAME
.Nm trunk
.Nd link aggregation and link failover interface
.Sh SYNOPSIS
.Cd "pseudo-device trunk" Op Ar count
.Sh DESCRIPTION
The
.Nm
interface allows aggregation of multiple network interfaces as one virtual
.Nm
interface.
.Pp
A
.Nm
interface can be created using the
.Ic ifconfig trunk Ns Ar N Ic create
command.
It can use different link aggregation protocols specified
using the
.Ic trunkproto Ar proto
option.
Child interfaces can be added using the
.Ic trunkport Ar child-iface
option and removed using the
.Ic -trunkport Ar child-iface
option.
.Pp
The driver currently supports the trunk protocols
.Ic roundrobin
.Oo
.Ic default
.Oc ,
.Ic failover ,
and
.Ic none
for link aggregation and link failover.
.Pp
The
.Ic roundrobin
protocol distributes outgoing traffic using a round-robin scheduler
through all active ports; and
.Ic failover
protocol sends outgoing traffic only through the master or the next
active port.
Both protocols receive traffic from all attached ports.
The interface link state is used to validate if the port is active or
not.
.Pp
The
.Ic none
protocol is intended to do nothing: it disables any traffic without
disabling the
.Nm
interface itself.
.Pp
The configuration can be done at runtime or by setting up a
.Xr hostname.if 5
configuration file for
.Xr netstart 8 .
.Sh EXAMPLES
Create a simple round robin trunk with two bge(4) Gigabit Ethernet
interfaces:
.Bd -literal -offset indent
# ifconfig bge0 up
# ifconfig bge1 up
# ifconfig trunk0 trunkport bge0 trunkport bge1 \e
192.168.1.1 netmask 255.255.255.0
.Ed
.Pp
The following example uses an active failover trunk to set up roaming
between wired and wireless networks using two network devices.
Whenever the wired master interface is unplugged, the wireless failover
device will be used:
.Bd -literal -offset indent
# ifconfig em0 up
# ifconfig ath0 192.168.1.1 netmask 255.255.255.0 nwid my_net
# ifconfig trunk0 trunkproto failover trunkport em0 trunkport ath0 \e
192.168.1.1 netmask 255.255.255.0
.Ed
.Sh SEE ALSO
.Xr inet 4 ,
.Xr hostname.if 5 ,
.Xr ifconfig 8 ,
.Xr netstart 8
.Sh HISTORY
The
.Nm
device appeared in
.Ox 3.8 .
.Sh AUTHORS
The
.Nm
driver was written by
.An Reyk Floeter Aq reyk@openbsd.org .
|