171 lines · 3.3 KB · Text
RawDownload
.TH BRIDGE 3.SH NAMEbridge \- IPv4 Ethernet bridge.SH SYNOPSIS.nf.B bind -a #B\fIb\fP /net .B /net/bridge\fIb\fP/ctl.B /net/bridge\fIb\fP/cache.B /net/bridge\fIb\fP/log.B /net/bridge\fIb\fP/stats.BI /net/bridge\fIb\fP/ n.BI /net/bridge\fIb\fP/ n /ctl.BI /net/bridge\fIb\fP/ n /local.BI /net/bridge\fIb\fP/ n /status.fi.SH DESCRIPTIONThe.I bridgedevice bridges IPv4 packets amongst Ethernet interfaces.The number.I bin the bind is optional and selects a particular bridge(default 0)..PPThe.B /net/bridge0directory contains.BR ctl ,.BR cache ,.BR log ,and.B statsfiles, and numbered subdirectories for each physical interface..PPOpening the.B ctlfile reserves an interface.The file descriptor returned from the.IR open (2)will point to the control file,.BR ctl ,of the newly allocated interface.Reading.B ctlreturns a text string representing the number of the interface.Writing.B ctlalters aspects of the interface.The possible.I ctlmessages are:.TF cacheflush.PD.TP.BI "bind ether " "name ownhash path"Treat the device mounted at.I path(e.g.,.LR /net/ether0 )as an Ethernet medium carrying IPv4 and ARP packetsand associate it with this bridge (forward its packets to theother interfaces associated with this bridge)..I Ownhashis an `owner hash'..TP.BI "bind tunnel " "name ownhash path path2Treat the device mounted at.I pathas a network tunnel carrying IPv4 and ARP packets,the device mounted at.I path2as an Ethernet medium carrying IPv4 and ARP packetsand associate them with this bridge(forward its packets to theother interfaces associated with this bridge).Read packets from the.I pathinterface and write them to the.I path2interface.Such tunnels have an MTU of 1400 bytes..TP.BI "unbind " "type address [ownhash]"Disassociate the interface associated with.I addressfrom this bridge..I Typemust be.L etheror.LR tunnel ..TP.B cacheflushClear the cache of (destination MAC address, port) tuples..TP.BI "delay " "delay0 delayn"Set the.I delay0and.I delaynparameters..I delay0is the constant microsecond delay per packetand.I delaynis the microsecond delay per byte..TP.BI "set " optionSet bridge.IR option .The only known option is.LR tcpmss ,which limits the TCP Maximum Segment Size ofTCPv4 packets passing through to 1300 bytes..TP.BI "clear " optionClear bridge.IR option ..PPReading.I statsreturns statistics about the bridge..PPReading the.I logfile returns data from the bridge's logand will block at end of file awaiting new data..PPReading the.B cachefile prints the cache of (destination MAC address, port) tuples,one entry per line.The format is:the destination MAC (e.g., Ethernet) address in hex,port number,count of packets from this address,count of packets to this address,expiry time in seconds since the epoch,and.L efor expired entries or.L vfor valid entries..PPIn a connection subdirectory,.B ctland.B localdon't do anything,but.B statusreturns a one-line status summary..SH EXAMPLESSet up a network bridge between two Ethernets.RL ( #l0and.LR #l1 )..IP.EXbind -a '#B' /netbind -a '#l1' /netecho 'bind ether outer 0 /net/ether0' >/net/bridge0/ctlecho 'bind ether inner 0 /net/ether1' >/net/bridge0/ctl.EE.SH "SEE ALSO".IR ip (3).SH SOURCE.B /sys/src/9/port/devbridge.c.SH BUGSDoesn't understand IPv6.