1.停止网络:/etc/init.d/network stop
2.修改网卡的配置文件:vim /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=50:e5:49:ba:70:f2
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.154
GATEWAY=192.168.1.1
TYPE=Ethernet
BRIDGE=br0
3.复制eth0,重命名为br0:cp-r /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-br0
4.修改/etc/sysconfig/network-scripts/ifcfg-br0
DEVICE="br0"
BOOTPROTO=static
HWADDR=50:e5:49:ba:70:f2
ONBOOT=yes
NETMASK=255.255.255.0
IPADDR=192.168.1.154
GATEWAY=192.168.1.1
TYPE="Bridge"
5.启动网络:/etc/init.d/network start