netbr
添加/删除/控制网桥。
格式
netbr [show/addbr/delbr/flush bridge0] | [adddev/deldev bridge0 ethdev0] | [addif/delif bridge0 en1]
说明
[root@sylixos:/root]# help netbr
add / delete / control net bridge.
eg. netbr show bridge0 (Show all net device in 'bridge0' net brigdge)
netbr addbr bridge0 (Add a net brigdge named 'bridge0')
netbr delbr bridge0 (Delete a net brigdge named 'bridge0')
netbr flush bridge0 (Flush all MAC cache in net brigdge named 'bridge0')
netbr adddev bridge0 ethdev0 (Add a net device in net brigdge named 'bridge0')
netbr deldev bridge0 ethdev0 (Delete a net device from net brigdge named 'bridge0')
netbr addif bridge0 en1 (Same as 'adddev' but use interface name)
netbr delif bridge0 en1 (Same as 'deldev' but use interface name)
netbr [...]
[root@sylixos:/root]#
此命令用于添加/删除/控制网桥。
样例
[root@sylixos:/apps]# netbr addbr bridge0
net bridge device add ok, if index: 7.
[root@sylixos:/apps]# ifconfig
br6 Link encap: Ethernet HWaddr: aa:10:5f:d6:61:22
Dev: bridge0 Ifidx: 7 DHCP: D4 D6 Spd: N/A
inet addr: 10.4.130.14 netmask: 255.255.0.0
gateway: 10.4.0.1 broadcast: 0.0.255.255
inet6 addr: fe80::a810:5fff:fed6:6122 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
collisions:0 txqueue:0 tcpaf:2 tcpwnd:65535
RX ucast packets:0 nucast packets:0 dropped:0
TX ucast packets:0 nucast packets:7 dropped:0
RX bytes:0 (0.0 B) TX bytes:546 (546.0 B