brctl addbr bridgename |
brctl addif bridgename device |
brctl delif bridgename device |
ifconfig bridgename up |
[root@demo1 mac]# /usr/sbin/brctl show bridge name bridge id STP enabled interfaces test 8000.0050bacecd17 no eth0 |
[root@demo1 mac]# /sbin/ifconfig -a eth0 Link encap:Ethernet HWaddr 00:50:BA:CE:CD:17 inet6 addr: fe80::250:baff:fece:cd17/64 Scope:Link Interrupt:12 Base address:0xa000 eth1 Link encap:Ethernet HWaddr 00:E0:4C:85:DB:D5 inet6 addr: fe80::2e0:4cff:fe85:dbd5/64 Scope:Link collisions:0 txqueuelen:1000 RX bytes:271724 (265.3 KiB) TX bytes:1426141 (1.3 MiB) Interrupt:5 Base address:0xdc00 test Link encap:Ethernet HWaddr 00:50:BA:CE:CD:17 inet6 addr: fe80::250:baff:fece:cd17/64 Scope:Link collisions:0 txqueuelen:0 RX bytes:36325 (35.4 KiB) |
ifconfig bridgename xxx.xxx.xxx.xxx netmask 255.255.255.0 |
[root@demo1 mac]# /sbin/ifconfig -a test Link encap:Ethernet HWaddr 00:50:BA:CE:CD:17 inet addr:10.4.1.105 Bcast:10.4.255.255 Mask:255.255.0.0 inet6 addr: fe80::250:baff:fece:cd17/64 Scope:Link collisions:0 txqueuelen:0 RX bytes:36325 (35.4 KiB) TX bytes:9804 |
[root@demo1 mac]# /usr/sbin/brctl show bridge name bridge id STP enabled interfaces test 8000.0050bacecd17 no eth0 |
brctl addbr bridgename |
brctl delbr bridgename |
brctl addif bridgename device |
brctl delif bridgename device |
# brctl showmacs br549 port no mac addr is local? ageing timer 1 00:00:4c:9f:0b:ae no 17.84 1 00:00:4c:9f:0b:d2 yes 0.00 2 00:00:4c:9f:0b:d3 yes 0.00 1 00:02:55:1a:35:09 no 53.84 1 00:02:55:1a:82:87 no 11.53 |
[root@demo1 mac]# cat /root/bridge #! /bin/sh # ifconfig eth0 0.0.0.0 # ifconfig eth1 0.0.0.0 /usr/sbin/brctl addbr test /usr/sbin/brctl addif test eth0 /usr/sbin/brctl addif test eth1 /sbin/ifconfig test up /sbin/ifconfig test 10.4.1.105 netmask 255.255.0.0 |
[root@demo1 mac]# vi /etc/rc.local #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. /root/bridge touch /var/lock/subsys/local |