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