Ifconfig eth0 0.0.0.0 #网卡IP没用了, kill.
Ifconfig eth1 0.0.0.0
Ifconfig eth2 0.0.0.0
Brctl ADDBR br0 #新建个桥
Brctl addif br0 eth0 #网卡添加到桥里面
Brctl addif br0 eth1
Brctl addif br0 eth2
Ifconfig br0 192.168.15.1/24 up #把桥启动, and initial IP and mask
Network Bridge configuration file: (online CP, has not been tested.) )
1. Set up the bridge Touch/etc/sysconfig/network-scripts/ifcfg-br0 set up the bridge configuration file Ifcfg-br0
Vi/etc/sysconfig/network-scripts/ifcfg-br0
Device=br0 Type=bridge Bootproto=static ipaddr=192.168.1.99 netmask=255.255.255.0 gateway=192.168.1.1 Onboot=yes |
2. Add the NIC to the Network Bridge
Add the eth0 and eth1 two network adapters to the bridge.
Modify the eth1 NIC configuration file
Vi/etc/sysconfig/network-scripts/ifcfg-eth0
Device=eth0 Type=ethernet Bootproto=static ipaddr=0.0.0.0 Onboot=yes Bridge=br0 |
Modify the eth2 NIC configuration file
Vi/etc/sysconfig/network-scripts/ifcfg-eth2
Device=eth1 Type=ethernet Bootproto=static ipaddr=0.0.0.0 Onboot=yes Bridge=br0 |
3. Set the bridge port
Brctl ADDBR br0 (add a bridge, if you create edit ifcfg-br0 manually, this command and some other commands to configure the bridge can not)
Brctl addif br0 eth0 (let eth0 become a port of br0, even if manually create edit ifcfg-br0, you also need to execute this command, otherwise you cannot network)
4. Restart the Network Service
Service NetworkManager Stop
Chkconfig NetworkManager off
Service Network Stop
Service Network start
Linux configuration Bridge mode for two-layer switching.