Bridge

為 Xen 搭建橋樑

  • July 4, 2013

我目前正堅持為 Xen 創建一座橋樑。我目前的介面文件如下所示:

     auto lo
     iface lo inet loopback

     auto eth0
     iface eth0 inet static
               address 81.30.152.XX
               netmask 255.255.255.0
               broadcast 81.30.152.255
               gateway 81.30.152.1

     auto xenbr0
     iface xenbr0 inet static
               address 81.30.152.XX
               netmask 255.255.255.0
               broadcast 81.30.152.255
               gateway 81.30.152.1
               bridge_ports eth0
               bridge_fd 9
               bridge_hello 2
               bridge_maxage 12
               bridge_stp off

但是 ifconfig 中沒有出現 xenbr0,我做錯了什麼?

謝謝!

第一步 編輯 /etc/xen/xend-config.sxp 並找到“(network-script network-bridge)”行,將其註釋掉,並用呼叫您自己的包裝腳本“(network-script network-多橋)”。在 /etc/xen/scripts/ 中稱為“network-multi-bridge”,它將呼叫 network-bridge 腳本兩次,每個介面一次。

#!/bin/sh
dir=$(dirname "$0")
"$dir/network-bridge" "$@" vifnum=0 bridge=xenbr0 netdev=eth0  
"$dir/network-bridge" "$@" vifnum=1 bridge=xenbr1 netdev=eth1

# chmod +x /etc/xen/scripts/network-multi-bridge

# service network restart

# ifconfig

引用自:https://serverfault.com/questions/496266