xref: /openbsd-src/share/man/man4/bridge.4 (revision f2da64fbbbf1b03f09f390ab01267c93dfd77c4c)
1.\"	$OpenBSD: bridge.4,v 1.75 2016/09/04 18:55:08 jmc Exp $
2.\"
3.\" Copyright (c) 1999-2001 Jason L. Wright (jason@thought.net)
4.\" All rights reserved.
5.\"
6.\" Redistribution and use in source and binary forms, with or without
7.\" modification, are permitted provided that the following conditions
8.\" are met:
9.\" 1. Redistributions of source code must retain the above copyright
10.\"    notice, this list of conditions and the following disclaimer.
11.\" 2. Redistributions in binary form must reproduce the above copyright
12.\"    notice, this list of conditions and the following disclaimer in the
13.\"    documentation and/or other materials provided with the distribution.
14.\"
15.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17.\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
18.\" DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19.\" INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20.\" (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21.\" SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23.\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
24.\" ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25.\" POSSIBILITY OF SUCH DAMAGE.
26.\"
27.Dd $Mdocdate: September 4 2016 $
28.Dt BRIDGE 4
29.Os
30.Sh NAME
31.Nm bridge
32.Nd Ethernet bridge interface
33.Sh SYNOPSIS
34.Cd "pseudo-device bridge"
35.Pp
36.In sys/types.h
37.In net/if.h
38.In netinet/in.h
39.In netinet/if_ether.h
40.In net/if_bridge.h
41.Sh DESCRIPTION
42The
43.Nm
44device creates a logical link between two or more Ethernet interfaces or
45encapsulation interfaces (see
46.Xr etherip 4 ) .
47This link between the interfaces selectively forwards frames from
48each interface on the bridge to every other interface on the bridge.
49A bridge can serve several services, including isolation of traffic between
50sets of machines so that traffic local to one set of machines is not
51available on the wire of another set of machines, and it can act as
52a transparent filter for
53.Xr ip 4
54datagrams.
55.Pp
56A
57.Nm
58interface can be created at runtime using the
59.Ic ifconfig bridge Ns Ar N Ic create
60command or by setting up a
61.Xr hostname.if 5
62configuration file for
63.Xr netstart 8 .
64.Pp
65The bridges provided by this interface are learning bridges with
66filtering; see
67.Xr pf 4 .
68In general a bridge works like a hub, forwarding traffic from one interface
69to another.
70It differs from a hub in that it will "learn" which machines
71are on each of its attached segments by actively listening to
72incoming traffic and examining the headers of each frame.
73A table is built containing the MAC address and segment to which the
74MAC address is attached.
75This allows a bridge to be more selective about what it forwards,
76which can be used to reduce traffic on a set of segments and also to provide
77an IP firewall without changing the topology of the network.
78.Pp
79The algorithm works as follows by default, but can be modified via
80.Xr ioctl 2
81or the utility
82.Xr ifconfig 8 .
83When a frame comes in, the origin segment and the source address are
84recorded.
85If the bridge has no knowledge about where the destination is to be found,
86the bridge will forward the frame to all attached segments.
87If the destination is known to be on a different segment from its origin, the
88bridge will forward the packet only to the destination segment.
89If the destination is on the same segment as the origin segment, the bridge
90will drop the packet because the receiver has already had a chance to see
91the frame.
92Before forwarding a frame, the bridge will check to see if the packet
93contains an
94.Xr ip 4
95or
96.Xr ip6 4
97datagram; if so, the datagram is run through the
98pf interface so that it can be filtered.
99See the
100.Sx NOTES
101section for details.
102.Sh SPANNING TREE
103The bridge has support for 802.1D-2004 Spanning Tree Protocol (STP),
104which can be used to detect and remove loops in a network topology.
105Using the
106.Cm stp
107or
108.Cm -stp
109commands
110to
111.Nm ,
112STP can be enabled or disabled on each port.
113.Pp
114The bridge will use the Rapid Spanning Tree Protocol (RSTP) by default
115to allow rapid transitions to the forwarding state.
116The
117.Cm proto
118command to
119.Nm
120can be used to force operation in the common Spanning Tree Protocol
121without rapid state transitions.
122Note that RSTP will be compatible with remote bridges running common STP.
123.Pp
124STP will not work on
125.Xr etherip 4
126members because they lack a hardware MAC address.
127.Sh SPAN PORTS
128The bridge can have interfaces added to it as span ports.
129Span ports transmit a copy of every frame received by the bridge.
130This is most useful for snooping a bridged network passively on
131another host connected to one of the span ports of the bridge.
132Span ports cannot be bridge members; instead, the
133.Cm addspan
134and
135.Cm delspan
136commands are used to add and delete span ports to and from a bridge.
137.Sh IOCTLS
138A
139.Nm
140interface responds to all of the
141.Xr ioctl 2
142calls specific to other interfaces listed in
143.Xr netintro 4 .
144The following
145.Xr ioctl 2
146calls are specific to
147.Nm
148devices.
149They are defined in
150.In sys/sockio.h .
151Some
152.Xr ioctl 2
153calls are used by
154.Xr switch 4
155as well.
156.Bl -tag -width Ds
157.It Dv SIOCBRDGIFS Fa "struct ifbifconf *"
158Retrieve member interface list from a bridge.
159This request takes an
160.Vt ifbifconf
161structure (see below) as a value-result parameter.
162The
163.Va ifbic_len
164field should be initially set to the size of the buffer
165pointed to by
166.Va ifbic_buf .
167On return it will contain the length, in bytes, of the configuration
168list.
169.Pp
170Alternatively, if the
171.Va ifbic_len
172passed in is set to 0,
173.Dv SIOCBRDGIFS
174will set
175.Va ifbic_len
176to the size that
177.Va ifbic_buf
178needs to be to fit the entire configuration list,
179and will not fill in the other parameters.
180This is useful for determining the exact size that
181.Va ifbic_buf
182needs to be in advance.
183.Pp
184The argument structure is defined as follows:
185.Bd -literal
186struct ifbreq {
187	char	  ifbr_name[IFNAMSIZ];	 /* bridge ifs name */
188	char	  ifbr_ifsname[IFNAMSIZ];/* member ifs name */
189	u_int32_t ifbr_ifsflags;  /* member ifs flags */
190	u_int8_t  ifbr_state;	  /* member stp state */
191	u_int8_t  ifbr_priority;  /* member stp priority */
192	u_int32_t ifbr_portno;	  /* member port number */
193	u_int32_t ifbr_path_cost; /* member stp path cost */
194};
195
196/* ifbr_ifsflags flags about interfaces */
197#define	IFBIF_LEARNING	 0x0001 /* ifs can learn */
198#define	IFBIF_DISCOVER	 0x0002 /* sends packets w/unknown dst */
199#define	IFBIF_BLOCKNONIP 0x0004 /* ifs blocks non-IP/ARP in/out */
200#define	IFBIF_STP	 0x0008 /* participate in spanning tree*/
201#define	IFBIF_SPAN	 0x0100 /* ifs is a span port (ro) */
202#define	IFBIF_RO_MASK	 0xff00 /* read only bits */
203
204struct ifbifconf {
205	char	  ifbic_name[IFNAMSIZ];	/* bridge ifs name */
206	u_int32_t ifbic_len;		/* buffer size */
207	union {
208		caddr_t	ifbicu_buf;
209		struct	ifbreq *ifbicu_req;
210	} ifbic_ifbicu;
211#define	ifbic_buf	ifbic_ifbicu.ifbicu_buf
212#define	ifbic_req	ifbic_ifbicu.ifbicu_req
213};
214.Ed
215.It Dv SIOCBRDGADD Fa "struct ifbreq *"
216Add the interface named in
217.Va ifbr_ifsname
218to the bridge named in
219.Va ifbr_name .
220.It Dv SIOCBRDGDEL Fa "struct ifbreq *"
221Delete the interface named in
222.Va ifbr_ifsname
223from the bridge named in
224.Va ifbr_name .
225.It Dv SIOCBRDGADDS Fa "struct ifbreq *"
226Add the interface named in
227.Va ifbr_ifsname
228as a span port to the bridge named in
229.Va ifbr_name .
230.It Dv SIOCBRDGDELS Fa "struct ifbreq *"
231Delete the interface named in
232.Va ifbr_ifsname
233from the list of span ports of the bridge named in
234.Va ifbr_name .
235.It Dv SIOCBRDGSIFFLGS Fa "struct ifbreq *"
236Set the bridge member interface flags for the interface named in
237.Va ifbr_ifsname
238attached to the bridge
239.Va ifbr_name .
240If the flag
241.Dv IFBIF_LEARNING
242is set on an interface, source addresses from frames received on the
243interface are recorded in the address cache.
244If the flag
245.Dv IFBIF_DISCOVER
246is set, the interface will receive packets destined for unknown
247destinations, otherwise a frame that has a destination not found
248in the address cache is not forwarded to this interface.
249The default for newly added interfaces has both flags set.
250If the flag
251.Dv IFBIF_BLOCKNONIP
252is set, only
253.Xr ip 4 ,
254.Xr ip6 4 ,
255.Xr arp 4 ,
256and
257Reverse ARP packets will be bridged from and to the interface.
258.It Dv SIOCBRDGGIFFLGS Fa "struct ifbreq *"
259Retrieve the bridge member interface flags for the interface named in
260.Va ifbr_ifsname
261attached to the bridge
262.Va ifbr_name .
263.It Dv SIOCBRDGRTS Fa "struct ifbaconf *"
264Retrieve the address cache of the bridge named in
265.Va ifbac_name .
266This request takes an
267.Vt ifbaconf
268structure (see below) as a value-result parameter.
269The
270.Va ifbac_len
271field should be initially set to the size of the buffer pointed to by
272.Va ifbac_buf .
273On return, it will contain the length, in bytes, of the configuration list.
274.Pp
275Alternatively, if the
276.Va ifbac_len
277passed in is set to 0,
278.Dv SIOCBRDGRTS
279will set it to the size that
280.Va ifbac_buf
281needs to be to fit the entire configuration list, and will not fill in the other
282parameters.
283As with
284.Dv SIOCBRDGIFS ,
285this is useful for determining the exact size that
286.Va ifbac_buf
287needs to be in advance.
288.Pp
289The argument structure is defined as follows:
290.Bd -literal
291struct ifbareq {
292	char	 ifba_name[IFNAMSIZ];	/* bridge name */
293	char	 ifba_ifsname[IFNAMSIZ];/* destination ifs */
294	u_int8_t ifba_age;		/* address age */
295	u_int8_t ifba_flags;		/* address flags */
296	struct ether_addr ifba_dst;	/* destination addr */
297};
298
299#define	IFBAF_TYPEMASK	0x03		/* address type mask */
300#define	IFBAF_DYNAMIC	0x00		/* dynamically learned */
301#define	IFBAF_STATIC	0x01		/* static address */
302
303struct ifbaconf {
304	char	  ifbac_name[IFNAMSIZ];	/* bridge ifs name */
305	u_int32_t ifbac_len;		/* buffer size */
306	union {
307		caddr_t	ifbacu_buf;	/* buffer */
308		struct ifbareq *ifbacu_req; /* request pointer */
309	} ifbac_ifbacu;
310#define	ifbac_buf	ifbac_ifbacu.ifbacu_buf
311#define	ifbac_req	ifbac_ifbacu.ifbacu_req
312};
313.Ed
314.Pp
315Address cache entries with the type set to
316.Dv IFBAF_DYNAMIC
317in
318.Va ifba_flags
319are entries learned by the bridge.
320Entries with the type set to
321.Dv IFBAF_STATIC
322are manually added entries.
323.It Dv SIOCBRDGSADDR Fa "struct ifbareq *"
324Add an entry, manually, to the address cache for the bridge named in
325.Va ifba_name .
326The address and its associated interface and flags are set in the
327.Va ifba_dst ,
328.Va ifba_ifsname ,
329and
330.Va ifba_flags
331fields, respectively.
332.It Dv SIOCBRDGDADDR Fa "struct ifbareq *"
333Delete an entry from the address cache of the bridge named in
334.Va ifba_name .
335Entries are deleted strictly based on the address field
336.Va ifba_dst .
337.It Dv SIOCBRDGFLUSH Fa "struct ifbreq *"
338Flush addresses from the cache.
339.Va ifbr_name
340contains the name of the bridge device, and
341.Va ifbr_ifsflags
342should be set to
343.Dv IFBF_FLUSHALL
344to flush all addresses from the cache or
345.Dv IFBF_FLUSHDYN
346to flush only the dynamically learned addresses from the cache.
347.It Dv SIOCBRDGSCACHE Fa "struct ifbrparam *"
348Set the maximum address cache size for the bridge named in
349.Va ifbrp_name
350to
351.Va ifbrp_csize
352entries.
353.Pp
354The argument structure is as follows:
355.Bd -literal
356struct ifbrparam {
357	char		  ifbrp_name[IFNAMSIZ];
358	union {
359		u_int32_t ifbrpu_csize;	    /* cache size */
360		int	  ifbrpu_ctime;	    /* cache time */
361		u_int16_t ifbrpu_prio;	    /* bridge priority */
362		u_int8_t  ifbrpu_hellotime; /* hello time */
363		u_int8_t  ifbrpu_fwddelay;  /* fwd delay */
364		u_int8_t  ifbrpu_maxage;    /* max age */
365		u_int64_t ifbrpu_datapath;  /* datapath-id */
366		u_int32_t ifbrpu_maxgroup;  /* group size */
367	} ifbrp_ifbrpu;
368};
369#define	ifbrp_csize	ifbrp_ifbrpu.ifbrpu_csize
370#define	ifbrp_ctime	ifbrp_ifbrpu.ifbrpu_ctime
371#define	ifbrp_prio	ifbrp_ifbrpu.ifbrpu_prio
372#define	ifbrp_hellotime	ifbrp_ifbrpu.ifbrpu_hellotime
373#define	ifbrp_fwddelay	ifbrp_ifbrpu.ifbrpu_fwddelay
374#define	ifbrp_maxage	ifbrp_ifbrpu.ifbrpu_maxage
375#define	ifbrp_datapath  ifbrp_ifbrpu.ifbrpu_datapath
376#define	ifbrp_maxflow   ifbrp_ifbrpu.ifbrpu_csize
377#define	ifbrp_maxgroup  ifbrp_ifbrpu.ifbrpu_maxgroup
378.Ed
379.Pp
380Note that the
381.Va ifbrp_ctime , ifbrp_hellotime , ifbrp_fwddelay
382and
383.Va ifbrp_maxage
384fields are in seconds.
385.It Dv SIOCBRDGGCACHE Fa "struct ifbrparam *"
386Retrieve the maximum size of the address cache for the bridge
387.Va ifbrp_name .
388.It Dv SIOCBRDGSTO Fa "struct ifbrparam *"
389Set the time, in seconds, for how long addresses which have not been
390seen on the network (i.e., have not transmitted a packet) will remain in
391the cache to the value
392.Va ifbrp_ctime .
393If the time is set to zero, no aging is performed on the address cache.
394.It Dv SIOCBRDGGTO Fa "struct ifbrparam *"
395Retrieve the address cache expiration time (see above).
396.It Dv SIOCBRDGARL Fa "struct ifbrlreq *"
397Add an Ethernet address filtering rule to the bridge on a specific interface.
398.Va ifbr_name
399contains the name of the bridge device, and
400.Va ifbr_ifsname
401contains the name of the bridge member interface.
402.Pp
403Rules are applied in the order in which they were added to the bridge,
404and the first matching rule's action parameter determines the fate of
405the packet.
406The
407.Va ifbr_action
408field is one of
409.Dv BRL_ACTION_PASS
410or
411.Dv BRL_ACTION_BLOCK ,
412to pass or block matching frames, respectively.
413The
414.Va ifbr_flags
415field specifies whether the rule should match on input, output, or both
416by using the flags
417.Dv BRL_FLAG_IN
418and
419.Dv BRL_FLAG_OUT .
420At least one of these flags must be set.
421.Pp
422The
423.Va ifbr_flags
424field
425also specifies whether either (or both) of the source and destination
426addresses should be matched by using the
427.Dv BRL_FLAG_SRCVALID
428and
429.Dv BRL_FLAG_DSTVALID
430flags.
431The
432.Va ifbr_src
433field is the source address that triggers the rule (only considered if
434.Va ifbr_flags
435has the
436.Dv BRL_FLAG_SRCVALID
437bit set).
438The
439.Va ifbr_src
440field is the destination address that triggers the rule (only considered if
441.Va ifbr_flags
442has the
443.Dv BRL_FLAG_DSTVALID
444bit set).
445If neither bit is set, the rule matches all frames.
446.Pp
447The argument structure is as follows:
448.Bd -literal
449struct ifbrlreq {
450	char	 ifbr_name[IFNAMSIZ];	 /* bridge ifs name */
451	char	 ifbr_ifsname[IFNAMSIZ]; /* member ifs name */
452	u_int8_t ifbr_action;		 /* disposition */
453	u_int8_t ifbr_flags;		 /* flags */
454	struct ether_addr ifbr_src;	 /* source mac */
455	struct ether_addr ifbr_dst;	 /* destination mac */
456	char	 ifbr_tagname[PF_TAG_NAME_SIZE]; /* pf tagname */
457};
458#define	BRL_ACTION_BLOCK	0x01	 /* block frame */
459#define	BRL_ACTION_PASS		0x02	 /* pass frame */
460#define	BRL_FLAG_IN		0x08	 /* input rule */
461#define	BRL_FLAG_OUT		0x04	 /* output rule */
462#define	BRL_FLAG_SRCVALID	0x02	 /* src valid */
463#define	BRL_FLAG_DSTVALID	0x01	 /* dst valid */
464.Ed
465.It Dv SIOCBRDGFRL Fa "struct ifbrlreq *"
466Remove all filtering rules from a bridge interface member.
467.Va ifbr_name
468contains the name of the bridge device, and
469.Va ifbr_ifsname
470contains the name of the bridge member interface.
471.It Dv SIOCBRDGGRL Fa "struct ifbrlconf *"
472Retrieve all of the rules from the bridge,
473.Va ifbrl_name ,
474for the member interface,
475.Va ifbrl_ifsname .
476This request takes an
477.Vt ifbrlconf
478structure (see below) as a value-result parameter.
479The
480.Va ifbrl_len
481field should be initially set to the size of the buffer pointed to by
482.Va ifbrl_buf .
483On return, it will contain the length, in bytes, of the configuration list.
484.Pp
485Alternatively, if the
486.Va ifbrl_len
487passed in is set to 0,
488.Dv SIOCBRDGGRL
489will set it to the size that
490.Va ifbrl_buf
491needs to be to fit the entire configuration list, and will not fill in the other
492parameters.
493As with
494.Dv SIOCBRDGIFS ,
495this is useful for determining the exact size that
496.Va ifbrl_buf
497needs to be in advance.
498.Pp
499The argument structure is defined as follows:
500.Bd -literal
501struct ifbrlconf {
502	char	  ifbrl_name[IFNAMSIZ];	   /* bridge ifs name */
503	char	  ifbrl_ifsname[IFNAMSIZ]; /* member ifs name */
504	u_int32_t ifbrl_len;		   /* buffer size */
505	union {
506		caddr_t	ifbrlu_buf;
507		struct	ifbrlreq *ifbrlu_req;
508	} ifbrl_ifbrlu;
509#define	ifbrl_buf ifbrl_ifbrlu.ifbrlu_buf
510#define	ifbrl_req ifbrl_ifbrlu.ifbrlu_req
511};
512.Ed
513.\" .It Dv SIOCBRDGGSIFS Fa "struct ifbreq *"
514.It Dv SIOCBRDGGPRI Fa "struct ifbrparam *"
515Retrieve the Spanning Tree Protocol (STP) priority parameter of the bridge into
516the
517.Va ifbrp_prio
518field.
519.It Dv SIOCBRDGSPRI Fa "struct ifbrparam *"
520Set the STP priority parameter of the bridge to the value in
521.Va ifbrp_prio .
522.It Dv SIOCBRDGGHT Fa "struct ifbrparam *"
523Retrieve the STP hello time parameter, in seconds, of the bridge into the
524.Va ifbrp_hellotime
525field.
526.It Dv SIOCBRDGSHT Fa "struct ifbrparam *"
527Set the STP hello time parameter, in seconds, of the bridge to the value in
528.Va ifbrp_hellotime .
529The value in
530.Va ifbrp_hellotime
531cannot be zero.
532.It Dv SIOCBRDGGFD Fa "struct ifbrparam *"
533Retrieve the STP forward delay parameter, in seconds, of the bridge into the
534.Va ifbrp_fwddelay
535field.
536.It Dv SIOCBRDGSFD Fa "struct ifbrparam *"
537Set the STP forward delay parameter, in seconds, of the bridge to the value in
538.Va ifbrp_fwddelay .
539The value in
540.Va ifbrp_fwddelay
541cannot be zero.
542.It Dv SIOCBRDGGMA Fa "struct ifbrparam *"
543Retrieve the STP maximum age parameter, in seconds, of the bridge into the
544.Va ifbrp_maxage
545field.
546.It Dv SIOCBRDGSMA Fa "struct ifbrparam *"
547Set the STP maximum age parameter, in seconds, of the bridge to the value in
548.Va ifbrp_maxage .
549The value in
550.Va ifbrp_maxage
551cannot be zero.
552.It Dv SIOCBRDGSIFPRIO Fa "struct ifbreq *"
553Set the STP priority parameter of the interface named in
554.Va ifbr_ifsname
555to the value in
556.Va ifbr_priority .
557.It Dv SIOCBRDGSIFCOST Fa "struct ifbreq *"
558Set the STP cost parameter of the interface named in
559.Va ifbr_ifsname
560to the value in
561.Va ifbr_path_cost .
562The value in
563.Va ifbr_path_cost
564must be greater than or equal to one.
565.El
566.Sh ERRORS
567If the
568.Xr ioctl 2
569call fails,
570.Xr errno 2
571is set to one of the following values:
572.Bl -tag -width Er
573.It Bq Er ENOENT
574For an add request, this means that the named interface is not configured
575into the system.
576For a delete operation, it means that the named interface is not a member
577of the bridge.
578For an address cache deletion, the address was not found in the table.
579.It Bq Er ENOMEM
580Memory could not be allocated for an interface or cache entry
581to be added to the bridge.
582.It Bq Er EEXIST
583The named interface is already a member of the bridge.
584.It Bq Er EBUSY
585The named interface is already a member of another bridge.
586.It Bq Er EINVAL
587The named interface is not an Ethernet interface, or an invalid ioctl
588was performed on the bridge.
589.It Bq Er ENETDOWN
590Address cache operation (flush, add, or delete) on a bridge that is
591in the down state.
592.It Bq Er EPERM
593Super-user privilege is required to add and delete interfaces to and from
594bridges and to set the bridge interface flags.
595.It Bq Er EFAULT
596The buffer used in a
597.Dv SIOCBRDGIFS
598or
599.Dv SIOCBRDGRTS
600request points outside of the process's allocated address space.
601.It Bq Er ESRCH
602No such member interface in the bridge.
603.El
604.Sh NOTES
605Bridged packets pass through
606.Xr pf 4
607filters once as input on the receiving interface and once
608as output on all interfaces on which they are forwarded.
609In order to pass through the bridge packets must pass
610any
611.Ar in
612rules on the input and any
613.Ar out
614rules on the output interface.
615Packets may be blocked either entering or leaving the bridge.
616.Pp
617Return packets generated by pf itself are not routed using the
618kernel routing table.
619Instead, pf will send these replies back to the same Ethernet
620address that the original packet came from.
621This applies to rules with
622.Ic return ,
623.Ic return-rst ,
624.Ic return-icmp ,
625.Ic return-icmp6 ,
626or
627.Ic synproxy
628defined.
629At the moment, only
630.Ic return-rst
631on IPv4 is implemented and the other packet generating rules
632are unsupported.
633.Pp
634If an IP packet is too large for the outgoing interface, the bridge
635will perform IP fragmentation.
636This can happen when bridge members
637have different MTUs or when IP fragments are reassembled by pf.
638Non-IP packets which are too large for the outgoing interface will be
639dropped.
640.Pp
641If the
642.Dv IFF_LINK2
643flag is set on the
644.Nm
645interface, the bridge will also perform transparent
646.Xr ipsec 4
647processing on the packets (encrypt or decrypt them), according to the
648policies set with the
649.Xr ipsecctl 8
650command by the administrator.
651If appropriate security associations (SAs) do not exist, any key
652management daemons such as
653.Xr isakmpd 8
654that are running on the bridge will be invoked to establish the
655necessary SAs.
656These daemons have to be configured as if they were running on the
657host whose traffic they are protecting (i.e., they need to have the
658appropriate authentication and authorization material, such as keys
659and certificates, to impersonate the protected host(s)).
660.Sh SEE ALSO
661.Xr errno 2 ,
662.Xr ioctl 2 ,
663.Xr arp 4 ,
664.Xr etherip 4 ,
665.Xr ip 4 ,
666.Xr ip6 4 ,
667.Xr ipsec 4 ,
668.Xr netintro 4 ,
669.Xr pf 4 ,
670.Xr switch 4 ,
671.Xr vether 4 ,
672.Xr hostname.if 5 ,
673.Xr ifconfig 8 ,
674.Xr ipsecctl 8 ,
675.Xr isakmpd 8 ,
676.Xr netstart 8
677.Sh HISTORY
678The
679.Nm
680kernel interface first appeared in
681.Ox 2.5 .
682.Sh AUTHORS
683The
684.Nm
685kernel interface was written by
686.An Jason L. Wright Aq Mt jason@thought.net
687as part of an undergraduate independent study at the
688University of North Carolina at Greensboro.
689.Pp
690Support for rapid spanning tree reconfigurations (RSTP) was added by
691.An Andrew Thompson Aq Mt thompsa@freebsd.org
692and ported to
693.Ox
694by
695.An Reyk Floeter Aq Mt reyk@openbsd.org .
696.Sh BUGS
697There are some rather special network interface chipsets which will
698not work in a bridge configuration.
699Some chipsets have serious flaws when running in promiscuous mode, like the
700TI ThunderLAN (see
701.Xr tl 4 ) ,
702which receives its own transmissions (this renders the address learning
703cache useless).
704Most other chipsets work fine though.
705