14 This bridge implementation is made obsolete by:
18 and will be removed from future releases.
22 supports bridging on Ethernet-type interfaces, including VLANs.
23 Bridging support can be either compiled into the kernel, or loaded
24 at runtime as a kernel module.
28 host can do bridging on independent sets of interfaces,
31 Each cluster connects a set of interfaces, and is
34 which is a number in the range 1..65535.
35 A cluster in fact is very similar to what commercial switches call
38 Note however that there is no relation whatsoever
39 between the cluster-ID and the IEEE 802.1q VLAN-ID which appears
40 in the header of packets transmitted on the wire.
41 In fact, in most cases there is no relation between the
44 used in most commercial switches, and
45 the IEEE 802.1q VLAN-ID.
47 By putting both physical and logical
49 interfaces in the same cluster, a
51 box can also implement what in commercial terms is called a
54 This means that packets
55 coming from one of the interfaces in a cluster
56 will appear on the wire of the
58 interface of any VLAN interface in a cluster,
59 with the proper VLAN tag.
61 coming from a parent interface of any VLAN interface in a cluster
62 will have the VLAN tag stripped,
63 and will be forwarded to other interfaces in a cluster.
66 section for more details.
68 Runtime operation of the
70 is controlled by several
72 variables, as follows.
73 .Bl -tag -width indent
74 .It Va net.link.ether.bridge.enable
77 to enable bridging, set to
80 .It Va net.link.ether.bridge.ipfw
85 processing of bridged packets.
90 Non-IP packets are accepted by default.
95 manpage for more details on the interaction of bridging
97 .It Va net.link.ether.bridge.ipf
102 processing of bridged packets.
107 Non-IP packets are accepted by default.
108 .It Va net.link.ether.bridge.config
109 Set to the list of interfaces to bridge.
110 Interfaces are separated by spaces, commas or tabs.
112 can be optionally followed by a colon and an integer indicating the
113 cluster it belongs to (defaults to 1 if the cluster-ID is missing), e.g.\&
114 .Dq Li "dc0:1,dc1,vlan0:3 dc2:3"
119 in cluster number 1, and
127 section for more examples.
129 The list of interfaces is rescanned every time the list is
130 modified, bridging is enabled, or new interfaces are created or
132 An explicit request to refresh the
134 configuration can also
135 be done by writing any value to
136 .Va net.link.ether.bridge.refresh .
137 Interfaces that are in the list but cannot be used
138 for bridging (because they are non-existing, or not Ethernet or VLAN)
139 are not used and a warning message is generated.
142 Bridging requires interfaces to be put in promiscuous mode,
143 and transmit packets with Ethernet source addresses different
145 Some interfaces (e.g.\&
147 do not support this functionality.
148 Also, bridging is not compatible with interfaces which
149 use hardware loopback, because there is no way to tell locally
150 generated packets from externally generated ones.
152 .Bl -tag -width ".Pa /boot/kernel/bridge.ko" -compact
153 .It Pa /boot/kernel/bridge.ko
160 configuration with three interfaces in the same
161 cluster can be set as follows.
162 No cluster-ID is specified here, which
163 will cause the interfaces to appear as part of cluster #1.
165 .Dl "sysctl net.link.ether.bridge.config=dc0,dc1,fxp1"
167 If you do not know what actual interfaces will be present on
168 your system, you can just put all existing interfaces in the
169 configuration, as follows:
171 .Dl sysctl net.link.ether.bridge.config="`ifconfig -l`"
173 This will result in a space-separated list of interfaces.
174 Out of the list, only Ethernet and VLAN interfaces will be
175 used for bridging, whereas for others the kernel will produce
178 More complex configurations can be used to create multiple
181 .Dl "sysctl net.link.ether.bridge.config=dc0:3,dc1:3,fxp0:4,fxp1:4"
183 will create two completely independent clusters.
185 Finally, interesting configurations involve VLANs and parent interfaces.
186 As an example, the following configuration will use interface
190 interface, and pass packets
191 for 802.1q VLANs 10 and 20 to physical interfaces
196 .Bd -literal -offset indent
197 sysctl net.link.ether.bridge.config=vlan0:34,dc1:34,vlan1:56,dc2:56
198 ifconfig vlan0 vlan 10 vlandev dc0
199 ifconfig vlan1 vlan 20 vlandev dc0
202 Note how there is no relation between the 802.1q VLAN identifiers
203 (10 and 20) and the cluster-ID's (34 and 56) used in
208 Note also that the trunk interface
209 does not even appear in the
211 as VLAN tag insertion/removal
215 When using VLAN devices, care must be taken by not creating loops
216 between these devices and their parent interfaces.
225 Bridging was introduced in
228 .An Luigi Rizzo Aq luigi@iet.unipi.it .
230 Care must be taken not to construct loops in the
233 The kernel supports only a primitive form of loop detection, by disabling
234 some interfaces when a loop is detected.
235 No support for a daemon running the
236 spanning tree algorithm is currently provided.
238 With bridging active, interfaces are in promiscuous mode,
239 thus causing some load on the system to receive and filter
240 out undesired traffic.
242 When passing bridged packets to
244 remember that only IP packets are passed to the firewall, while
245 other packets are silently accepted.
246 Also remember that bridged packets are accepted after the
247 first pass through the firewall irrespective of the setting
248 of the sysctl variable
249 .Va net.inet.ip.fw.one_pass ,
254 do not apply to bridged packets.
255 It might be useful to have a rule of the form
257 .Dl "skipto 20000 ip from any to any bridged"
259 near the beginning of your ruleset to implement specific rulesets