Instale os seguintes pacotes:
# aptitude install xen-tools xen-hypervisor-3.2-1-amd64 xen-linux-system-2.6.26-2-xen-amd64 xen-tools xen-utils-3.2-1
Reinicie o servidor:
# reboot
Verifique se está rodando o kernel correto:
# uname -a
Linux dom0 2.6.26-2-xen-amd64 #1 SMP Wed May 12 18:37:58 UTC 2010 x86_64
GNU/Linux
Verifique se o Xen está rodando:
# xm list
Name ID Mem VCPUs State Time(s)
Domain-0 0 3882 8 r----- 10.9
Criando as quatro bridges
Verifique o status das bridges:
# brctl show
bridge name bridge id STP enabled interfaces
Crie o script
network-xen-multi-bridge com o conteúdo abaixo:
# vim /etc/xen/scripts/network-xen-multi-bridge
#!/bin/sh
#network-xen-multi-bridge
#Exit if anything goes wrong
set -e
#First arg is operation.
OP=$1
shift
script=/etc/xen/scripts/network-bridge
case ${OP} in
start)
$script start vifnum=0 netdev=eth0
$script start vifnum=1 netdev=eth1
$script start vifnum=2 netdev=eth2
$script start vifnum=3 netdev=eth3
;;
stop)
$script stop vifnum=0 netdev=eth0
$script stop vifnum=1 netdev=eth1
$script stop vifnum=2 netdev=eth2
$script stop vifnum=3 netdev=eth3
;;
status)
$script status vifnum=0 netdev=eth0
$script status vifnum=1 netdev=eth1
$script status vifnum=2 netdev=eth2
$script status vifnum=3 netdev=eth3
;;
*)
echo 'Unknown command: ' ${OP}
echo 'Valid commands are: start, stop, status'
exit 1
esac
Verifique suas permissões:
# ls /etc/xen/scripts/network-xen-multi-bridge
-rw-r--r-- 1 root root 742 Jun 24 14:39 /etc/xen/scripts/network-xen-multi-bridge
Torne-o executável:
# chmod u+x /etc/xen/scripts/network-xen-multi-bridge
Verifique novamente suas permissões:
# ls /etc/xen/scripts/network-xen-multi-bridge
-rwxr--r-- 1 root root 742 Jun 24 14:39 /etc/xen/scripts/network-xen-multi-bridge
Edite o arquivo xend-config.sxp e comente a seguinte linha do network-script original e adicione a linha que indica nosso script logo abaixo, deixando-a descomentada:
# vim /etc/xen/xend-config.sxp
#(network-script network-dummy)
(network-script network-xen-multi-bridge)
Reinicie o serviço xend:
# /etc/init.d/xend restart
Restarting XEN control daemon: xendWaiting for peth0 to negotiate link...
Waiting for peth1 to negotiate link...
Waiting for peth2 to negotiate link...
Waiting for peth3 to negotiate link.
Verifique novamente o status das bridges:
# brctl show
bridge name bridge id STP enabled interfaces
eth0 8000.001517ab0566 no peth0
eth1 8000.001517ab0567 no peth1
eth2 8000.002219bd581b no peth2
eth3 8000.002219bd581d no peth3