xen4.1.2网桥配置

在xen4.1之前,通过设置/etc/xen/xend-config.sxp中的(network-script network-bridge)可以让xend来自动设置网桥。但是xen4.1之后不建议这么做:

When using the xl toolstack the host networking configuration is not configured by the toolstack but rather administrators are required to setup an appropriate network configuration using the tools provided by their host distribution.

From Xen 4.1 onwards the xend toolstack will only reconfigure the host network stack if the network stack does not appear to have been configured already (e.g. no bridges currently exist). This change allows administrators who wish to configure the network stack themselves to do so by default while preserving the existing behaviour for those who do not.

Other toolstack's requirements may differ. e.g. XCP contains its own mechanisms for configuring networking which should be used instead.

It is recommended to use the xenbrN naming convention for maximum compatibility.

 
As of the time of writing (Fedora 12), NetworkManager still does not support bridging, so it is necessary to use "classic" network initscripts for the bridge, and to explicitly mark them as independent from NetworkManager (the "NM_CONTROLLED=no" lines in the scripts below).
If desired you can completely disable the NetworkManager by running the following commands:
# chkconfig NetworkManager off
# chkconfig network on
# service NetworkManager stop
# service network start
 
手动设置网桥:
 
刚开机时可以看到默认网桥为tmpbridge且没有将物理网卡添加到网桥上:
# brctl show
bridge name     bridge id               STP enabled     interfaces
tmpbridge               8000.000000000000       no
 
删除tmpbridge: brctl delbr tmpbridge
添加一个新的网桥: brctl addbr xenbr0
 
配置网络参数:
# cat /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
HWADDR="1C:6F:65:23:03:FE"
BRIDGE=xenbr0
ONBOOT="yes"
# cat /etc/sysconfig/network-scripts/ifcfg-xenbr0
DEVICE="xenbr0"
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT="yes"
 
重启网络: 
# /etc/init.d/network restart
Shutting down interface xenbr0:                            [  OK  ]
Shutting down interface eth0:                              [  OK  ]
Shutting down loopback interface:                          [  OK  ]
Bringing up loopback interface:                            [  OK  ]
Bringing up interface eth0:                                [  OK  ]
Bringing up interface xenbr0: 
Determining IP information for xenbr0... done.
                                                           [  OK  ]
原文地址:https://www.cnblogs.com/feisky/p/2441290.html