启动xen的vps的时候,vps已经启动,但是网络不通。我们通常会 vi /etc/xen/xend-config.sxp 添加 (network-script network-bridge) ,如果成功就一切ok。有时候,在配置xend的时候,出现 network-bridge启动错误 eth0: binary operator expected 和 Error: eigther "dev" is duplicate, or "eth0" is a garbage,通常可能是有eth0:0这样的下级网卡造成的,删除后,重启服务器,就可能正常。
正常的现象是:重启xend: service xend restart 后能在ifconfig -a 看到 peth0
命令:brctl show 也能看到 peth0
bridge name bridge id STP enabled interfaces
eth0 8000.0025904eeed0 no peth0
如果只能看到tmpbridge表示xend不正常。
如果网卡不是eth0,而是eth2,vi /etc/xen/xend-config.sxp需要改成如下
(network-script 'network-bridge netdev=eth2')
在已经有vps启动的情况下,需要重启服务器才能生效,interfaces会看到peth2
eth0-is-a-garbage.png
(network-script 'network-bridge netdev=eth1')
桥接前 ethtool eth1 检查网卡带宽接口是否正确;桥接后,桥接名变成了eth1,真实网卡实际上是peth1,这时候就要用 ethtool peth0 来检查网卡是否工作
There are two common naming schemes when using bridged networking. In one scheme the physical device eth0 is renamed to peth0 and a bridge named eth0 is created(# The bridge is named eth0, by default (yes, really!) 这里就是用的这种). In the other the physical device remains eth0 while the bridge is named xenbr0 (or br0 etc). We shall use the eth0+xenbr0 naming scheme here.