xref: /netbsd/sbin/brconfig/brconfig.8 (revision c4a72b64)
1.\"	$NetBSD: brconfig.8,v 1.5 2002/11/06 05:23:57 enami Exp $
2.\"
3.\" Copyright 2001 Wasabi Systems, Inc.
4.\" All rights reserved.
5.\"
6.\" Written by Jason R. Thorpe for Wasabi Systems, Inc.
7.\"
8.\" Redistribution and use in source and binary forms, with or without
9.\" modification, are permitted provided that the following conditions
10.\" are met:
11.\" 1. Redistributions of source code must retain the above copyright
12.\"    notice, this list of conditions and the following disclaimer.
13.\" 2. Redistributions in binary form must reproduce the above copyright
14.\"    notice, this list of conditions and the following disclaimer in the
15.\"    documentation and/or other materials provided with the distribution.
16.\" 3. All advertising materials mentioning features or use of this software
17.\"    must display the following acknowledgement:
18.\"	This product includes software developed for the NetBSD Project by
19.\"	Wasabi Systems, Inc.
20.\" 4. The name of Wasabi Systems, Inc. may not be used to endorse
21.\"    or promote products derived from this software without specific prior
22.\"    written permission.
23.\"
24.\" THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``AS IS'' AND
25.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
26.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
27.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL WASABI SYSTEMS, INC
28.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34.\" POSSIBILITY OF SUCH DAMAGE.
35.\"
36.Dd August 17, 2001
37.Dt BRCONFIG 8
38.Os
39.Sh NAME
40.Nm brconfig
41.Nd configure network bridge parameters
42.Sh SYNOPSIS
43.Nm ""
44.Fl a
45.Nm ""
46.Ar bridge
47.Nm ""
48.Ar bridge
49.Ar command
50.Op Ar args ...
51.Sh DESCRIPTION
52The
53.Nm
54utility is used to configure network bridge parameters and retrieve
55network bridge parameters and status from the kernel.
56The bridging function is implemented by the
57.Xr bridge 4
58driver.
59.Pp
60A network bridge creates a logical link between two or more
61IEEE 802 networks that use the same (or
62.Dq similar enough )
63framing format.
64For example, it is possible to bridge Ethernet
65and 802.11 networks together, but it is not possible to bridge
66Ethernet and Token Ring together.
67.Pp
68Bridge interfaces are created using the
69.Xr ifconfig 8
70command's
71.Dq create
72sub-command.
73All other bridge configuration is performed using
74.Nm "" .
75.Pp
76The options are as follows:
77.Bl -tag -width indent
78.It Fl a
79Display the status of all bridge devices present on the system.
80This flag is mutually exclusive with all other sub-commands.
81.El
82.Pp
83All other operations require that a bridge be specified.
84If a bridge is specified with no sub-commands,
85the status of that bridge is displayed.
86The following sub-commands are available:
87.Pp
88.Bl -tag -width indent
89.It Cm up
90Start forwarding packets on the bridge.
91.It Cm down
92Stop forwarding packets on the bridge.
93.It Cm add Ar interface
94Add the interface named by
95.Ar interface
96as a member of the bridge.
97The interface is put into promiscuous mode
98so that it can receive every packet sent on the network.
99.It Cm delete Ar interface
100Remove the interface named by
101.Ar interface
102from the bridge.
103Promiscuous mode is disabled on the interface when
104it is removed from the bridge.
105.It Cm maxaddr Ar size
106Set the size of the bridge address cache to
107.Ar size .
108The default is 100 entries.
109.It Cm timeout Ar seconds
110Set the timeout of address cache entries to
111.Ar seconds
112seconds.
113If
114.Ar seconds
115is zero, then address cache entries will not be expired.
116The default is 240 seconds.
117.It Cm deladdr Ar address
118Delete
119.Ar address
120from the address cache.
121.It Cm flush
122Delete all dynamically-learned addresses from the address cache.
123.It Cm flushall
124Delete all addresses, including static addresses, from the address cache.
125.It Cm discover Ar interface
126Mark an interface as a
127.Dq discovering
128interface.
129When the bridge has no address cache entry
130(either dynamic or static)
131for the destination address of a packet,
132the bridge will forward the packet to all
133member interfaces marked as
134.Dq discovering .
135This is the default for all interfaces added to a bridge.
136.It Cm -discover Ar interface
137Clear the
138.Dq discovering
139attribute on a member interface.
140For packets without the
141.Dq discovering
142attribute, the only packets forwarded on the interface are broadcast
143or multicast packets and packets for which the destination address
144is known to be on the interface's segment.
145.It Cm learn Ar interface
146Mark an interface as a
147.Dq learning
148interface.
149When a packet arrives on such an interface, the source
150address of the packet is entered into the address cache as being a
151destination address on the interface's segment.
152This is the default for all interfaces added to a bridge.
153.It Cm -learn Ar interface
154Clear the
155.Dq learning
156attribute on a member interface.
157.It Cm stp Ar interface
158Enable Spanning Tree protocol on
159.Ar interface .
160The
161.Xr bridge 4
162driver has support for the IEEE 802.1D Spanning Tree protocol (STP).
163Spanning Tree is used to detect and remove loops in a network topology.
164.It Cm -stp Ar interface
165Disable Spanning Tree protocol on
166.Ar interface .
167This is the default for all interfaces added to a bridge.
168.It Cm maxage Ar seconds
169Set the time that a Spanning Tree protocol configuration is valid.
170The default is 20 seconds.
171The minimum is 1 second and the maximum is 255 seconds.
172.It Cm fwddelay Ar seconds
173Set the time that must pass before an interface begins forwarding
174packets when Spanning Tree is enabled.
175The default is 15 seconds.
176The minimum is 1 second and the maximum is 255 seconds.
177.It Cm hellotime Ar seconds
178Set the time between broadcasting of Spanning Tree protocol
179configuration messages.
180The default is 2 seconds.
181The minimum is 1 second and the maximum is 255 seconds.
182.It Cm priority Ar value
183Set the bridge priority for Spanning Tree.
184The default is 32768.
185The minimum is 0 and the maximum is 65536.
186.It Cm ifpriority Ar interface Ar value
187Set the Spanning Tree priority of
188.Ar interface
189to
190.Ar value .
191The default is 128.
192The minimum is 0 and the maximum is 255.
193.El
194.Sh EXAMPLES
195The following then placed in the file
196.Pa /etc/ifconfig.bridge0
197will cause the a bridge called
198.Sq bridge0
199to be created, and will add the interfaces
200.Sq ray0
201and
202.Sq fxp0
203to the bridge, and then enable packet forwarding.
204Such a configuration could be used to implement a simple
205802.11-to-Ethernet bridge (assuming the 802.11 interface is
206in ad-hoc mode).
207.Bd -literal -offset indent
208create
209!brconfig $int add ray0 add fxp0 up
210.Ed
211.Pp
212Consider a system with two 4-port Ethernet boards.
213The following placed in the file
214.Pa /etc/ifconfig.bridge0
215will cause a bridge consisting of all 8 ports with Spanning Tree
216enabled to be created:
217.Bd -literal -offset indent
218create
219!brconfig $int \e
220    add tlp0 stp tlp0 \e
221    add tlp1 stp tlp1 \e
222    add tlp2 stp tlp2 \e
223    add tlp3 stp tlp3 \e
224    add tlp4 stp tlp4 \e
225    add tlp5 stp tlp5 \e
226    add tlp6 stp tlp6 \e
227    add tlp7 stp tlp7 \e
228    up
229.Ed
230.Sh SEE ALSO
231.Xr bridge 4 ,
232.Xr ifconfig.if 5 ,
233.Xr ifconfig 8
234.Sh HISTORY
235The
236.Nm
237utility first appeared in
238.Nx 1.6 .
239.Sh AUTHORS
240The
241.Xr bridge 4
242driver and
243.Nm
244utility were originally written by
245.An Jason L. Wright
246.Aq jason@thought.net
247as part of an undergraduate independent study at the
248University of North Carolina at Greensboro.
249.Pp
250This version of the
251.Nm
252utility was written from scratch by
253.An Jason R. Thorpe
254.Aq thorpej@wasabisystems.com .
255