在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.
bridge name bridge id STP enabled interfaces
tmpbridge 8000.000000000000 no
DEVICE="eth0"
HWADDR="1C:6F:65:23:03:FE"
BRIDGE=xenbr0
ONBOOT="yes"
DEVICE="xenbr0"
TYPE=Bridge
BOOTPROTO=dhcp
ONBOOT="yes"
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 ]