RHEL6配置网桥

众荷喧哗 2011-12-19

1、由于NetworkManager不支持bridging,所以,需要disable NetworkManager servcie.

# /etc/init.d/NetworkManager stop
# service NetworkManager off

2、# cd /etc/sysconfig/network-scripts/

     # vi ifcfg-eth0 如下

    
DEVICE=eth0
TYPE=Ethernet
HWADDR=1c:6f:65:dd:d4:d8
NM_CONTROLLED=yes
ONBOOT=yes
BOOTPROTO=dhcp
BRIDGE="vSwitch0"

 

    # vi ifcfg-vSwitch0    桥配置文件

DEVICE=vSwitch0
HWADDR=1c:6f:65:dd:d4:d8
TYPE=Bridge
BOOTPROTO=static
IPADDR=10.10.10.65
NETMASK=255.255.255.0
GATEWAY=10.10.10.1
BROADCAST=10.10.255.255
DNS1=10.10.10.21
ONBOOT=yes

3、重启系统

# init 6

搞定

4、查看桥

# brctl show
bridge name     bridge id               STP enabled     interfaces
vSwitch0                8000.1c6f65ddd4d8       no              eth0
                                                        vnet0
virbr0          8000.000000000000       yes

如果要打开vSwitch0的STP,操作如下:

# brctl stp vSwitch0 on
# brctl show
bridge name     bridge id               STP enabled     interfaces
vSwitch0                8000.1c6f65ddd4d8       yes             eth0
                                                                                    vnet0
virbr0          8000.000000000000       yes

相关推荐