1.\" $NetBSD: brconfig.8,v 1.3 2001/11/16 11:26:53 wiz 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. The bridging 56function 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. For example, it is possible to bridge Ethernet 64and 802.11 networks together, but it is not possible to bridge 65Ethernet and Token Ring together. 66.Pp 67Bridge interfaces are created using the 68.Xr ifconfig 8 69command's 70.Dq create 71sub-command. All other bridge configuration is performed using 72.Nm "" . 73.Pp 74The options are as follows: 75.Bl -tag -width indent 76.It Fl a 77Display the status of all bridge devices present on the system. This 78flag is mutually exclusive with all other sub-commands. 79.El 80.Pp 81All other operations require that a bridge be specified. If a 82bridge is specified with no sub-commands, the status of that bridge 83is displayed. The following sub-commands are available: 84.Pp 85.Bl -tag -width indent 86.It Cm up 87Start forwarding packets on the bridge. 88.It Cm down 89Stop forwarding packets on the bridge. 90.It Cm add Ar interface 91Add the interface named by 92.Ar interface 93as a member of the bridge. The interface is put into promiscuous mode 94so that it can receive every packet sent on the network. 95.It Cm delete Ar interface 96Remove the interface named by 97.Ar interface 98from the bridge. Promiscuous mode is disabled on the interface when 99it is removed from the bridge. 100.It Cm maxaddr Ar size 101Set the size of the bridge address cache to 102.Ar size . 103The default is 100 entries. 104.It Cm timeout Ar seconds 105Set the timeout of address cache entries to 106.Ar seconds 107seconds. If 108.Ar seconds 109is zero, then address cache entries will not be expired. The 110default is 240 seconds. 111.It Cm deladdr Ar address 112Delete 113.Ar address 114from the address cache. 115.It Cm flush 116Delete all dynamically-learned addresses from the address cache. 117.It Cm flushall 118Delete all addresses, including static addresses, from the address cache. 119.It Cm discover Ar interface 120Mark an interface as a 121.Dq discovering 122interface. When the bridge has no 123address cache entry (either dynamic or static) for the destination address 124of a packet, the bridge will forward the packet to all member interfaces 125marked as 126.Dq discovering . 127This is the default for all interfaces added to a bridge. 128.It Cm -discover Ar interface 129Clear the 130.Dq discovering 131attribute on a member interface. For packets without the 132.Dq discovering 133attribute, the only packets forwarded on the interface are broadcast 134or multicast packets and packets for which the destination address 135is known to be on the interface's segment. 136.It Cm learn Ar interface 137Mark an interface as a 138.Dq learning 139interface. When a packet arrives on such an interface, the source 140address of the packet is entered into the address cache as being a 141destination address on the interface's segment. This is the default 142for all interfaces added to a bridge. 143.It Cm -learn Ar interface 144Clear the 145.Dq learning 146attribute on a member interface. 147.It Cm stp Ar interface 148Enable Spanning Tree protocol on 149.Ar interface . 150The 151.Xr bridge 4 152driver has support for the IEEE 802.1D Spanning Tree protocol (STP). 153Spanning Tree is used to detect and remove loops in a network topology. 154.It Cm -stp Ar interface 155Disable Spanning Tree protocol on 156.Ar interface . 157This is the default for all interfaces added to a bridge. 158.It Cm maxage Ar seconds 159Set the time that a Spanning Tree protocol configuration is valid. The 160default is 20 seconds. The mininum is 1 second and the maximum is 255 161seconds. 162.It Cm fwddelay Ar seconds 163Set the time that must pass before an interface begins forwarding 164packets when Spanning Tree is enabled. The default is 15 seconds. The 165mininum is 1 second and the maximum is 255 seconds. 166.It Cm hellotime Ar seconds 167Set the time between broadcasting of Spanning Tree protocol 168configuration messages. The default is 2 seconds. The minimum is 1 169second and the maximum is 255 seconds. 170.It Cm priority Ar value 171Set the bridge priority for Spanning Tree. The default is 32768. 172The minimum is 0 and the maximum is 65536. 173.It Cm ifpriority Ar interface Ar value 174Set the Spanning Tree priority of 175.Ar interface 176to 177.Ar value . 178The default is 128. The minimum is 0 and the maximum is 255. 179.El 180.Sh EXAMPLES 181The following then placed in the file 182.Pa /etc/ifconfig.bridge0 183will cause the a bridge called 184.Sq bridge0 185to be created, and will add the interfaces 186.Sq ray0 187and 188.Sq fxp0 189to the bridge, and then enable packet forwarding. Such a 190configuration could be used to implement a simple 191802.11-to-Ethernet bridge (assuming the 802.11 interface is 192in ad-hoc mode). 193.Bd -literal -offset indent 194create 195!brconfig $int add ray0 add fxp0 up 196.Ed 197.Pp 198Consider a system with two 4-port Ethernet boards. The following 199placed in the file 200.Pa /etc/ifconfig.bridge0 201will cause a bridge consisting of all 8 ports with Spanning Tree 202enabled to be created: 203.Bd -literal -offset indent 204create 205!brconfig $int \e 206 add tlp0 stp tlp0 \e 207 add tlp1 stp tlp1 \e 208 add tlp2 stp tlp2 \e 209 add tlp3 stp tlp3 \e 210 add tlp4 stp tlp4 \e 211 add tlp5 stp tlp5 \e 212 add tlp6 stp tlp6 \e 213 add tlp7 stp tlp7 \e 214 up 215.Ed 216.Sh SEE ALSO 217.Xr bridge 4 , 218.Xr ifconfig.if 5 , 219.Xr ifconfig 8 220.Sh HISTORY 221The 222.Nm 223utility first appeared in 224.Nx 1.6 . 225.Sh AUTHORS 226The 227.Xr bridge 4 228driver and 229.Nm 230utility were originally written by 231.An Jason L. Wright 232.Aq jason@thought.net 233as part of an undergraduate independent study at the 234University of North Carolina at Greensboro. 235.Pp 236This version of the 237.Nm 238utility was written from scratch by 239.An Jason R. Thorpe 240.Aq thorpej@wasabisystems.com . 241