The bridge device bridges packets amongst Ethernet interfaces.
The number b in the bind is optional and selects a particular
bridge (default 0). |
The /net/bridge0 directory contains ctl, cache, log, and stats
files, and numbered subdirectories for each physical interface.
Opening the ctl file reserves an interface. The file descriptor
returned from the open(2) will point to the control file, ctl,
of the newly allocated interface. Reading ctl returns a text string
representing the number of the interface. Writing ctl alters aspects
of the interface. The possible ctl messages are:
bind ether name ownhash path [pvid[#prio][,vlans...]]
bind bypass name ownhash path [pvid[#prio][,vlans...]]
Treat the device mounted at path (e.g., /net/ether0) as an Ethernet
medium and associate it with this bridge (forward its packets
to the other interfaces associated with this bridge). Ownhash
is an `owner hash'. The optional [pvid[#prio][,vlans...]] argument
is explained in vlan command below.
bind tunnel name ownhash path path2 [pvid[#prio][,vlans...]]
This is the same as ether above, but bypasses the physical interface,
ignoring all received frames from the interface and diverts all
frames transmitted on that interface to the bridge.|
vlan pvid[#prio][,vlans...] type name [ownhash]
Treat the device mounted at path as a network tunnel carrying
Ethernet packets, the device mounted at path2 as an Ethernet and
associate them with this bridge (forward its packets to the other
interfaces associated with this bridge). Read packets from the
path interface and write them to the path2 interface.
Such tunnels have an MTU of 1400 bytes.|
unbind type name [ownhash]
Change the 802.1Q VLAN configuration of a port identified by type,
name and ownhash. The pvid is the "Native" VLAN id associated with
untagged packets on a port. Packets with a VLAN id of pvid will
be send out untagged on the port. Untagged packets received on
the port will be tagged with the pvid. When
pvid was not specified in a bind command above, ports default
to a pvid of 1. The pvid can be specified as 0 when untagged packets
should be ignored on a port. The optional prio argument specifies
the default priority to assign to a incoming untagged packet on
the port between 0 (lowest, default) and 7
(highest). The vlans... argument specifies comma separated ranges
of other VLAN id's that the port is a member of (for trunk ports).
Membership means the port is accepting tagged packets with VLAN
id's listed here and ignores VLAN id's not listed here. Once accepted,
packets are forwarded only to other
ports that are members of the same (accepted) VLAN id. Unless
pvid is 0, a port is always a member of its own pvid VLAN id,
so it does not need to be listed twice.|
Disassociate the interface associated with name from this bridge.
Type must be ether or tunnel.|
delay delay0 delayn
Clear the cache of (destination MAC address, VLAN id, port) tuples.|
Set the delay0 and delayn parameters. delay0 is the constant microsecond
delay per packet and delayn is the microsecond delay per byte.|
Set bridge option. The only known option is tcpmss, which limits
the TCP Maximum Segment Size of TCP packets passing through to
Reading stats returns statistics about the bridge.
Reading the log file returns data from the bridge's log and will
block at end of file awaiting new data.
Reading the cache file prints the cache of (destination MAC address,
VLAN id, port) tuples, one entry per line. The format is: the
destination MAC (e.g., Ethernet) address in hex, VLAN id, port
number, count of packets from this address, count of packets to
this address, expiry time in seconds since the epoch, and e
for expired entries or v for valid entries.
In a connection subdirectory, ctl and local don't do anything,
but status returns a one–line status summary.