No meu host KVM (Ubuntu 14.04 LTS), quero configurar uma rede privada para os convidados com IP estático e acesso à Internet. O host está em uma máquina remota. Eu tenho a seguinte configuração no etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# Local network interface
auto br1
iface br1 inet static
address 10.0.0.1
network 10.0.0.0
netmask 255.255.255.224
broadcast 10.0.0.31
bridge_ports eth1
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
# The primary network interface and bridge
auto br0
iface br0 inet static
address xx.xx.xx.xx
gateway xx.xx.xx.xx
netmask 255.255.255.0
network xx.xx.xx.xx
broadcast xx.xx.xx.xx
dns-nameservers xx.xx.xx.xx xx.xx.xx.xx
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Agora, eu instalo os convidados com o comando:
virt-install \
--name ubuntu1 \
--ram 256 \
--disk path=/var/kvm/images/ubuntu1.img,size=5 \
--vcpus 1 \
--os-type linux \
--os-variant ubuntutrusty \
--network bridge=virbr0,model=virtio \
--network bridge=br1,model=virtio \
--graphics none \
--console pty,target_type=serial \
--location 'http://us.archive.ubuntu.com/ubuntu/dists/trusty/main/installer-amd64/' \
--extra-args 'console=ttyS0,115200n8 serial'
Eu faço o virbr0 como a interface principal e a instalação é concluída com sucesso. Após a instalação, eu defini o /etc/network/interfaces
em guest como:
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
# The loopback network interface
auto lo
iface lo inet loopback
# The primary network interface
auto eth0
iface eth0 inet dhcp
# Local network interface
auto eth1
iface eth1 inet static
address 10.0.0.2
network 10.0.0.0
netmask 255.255.255.224
broadcast 10.0.0.31
Com isso, os convidados obtêm o acesso à Internet de virbr0
e com br1
obtém um IP estático na rede privada interna.
Agora, minha pergunta é: posso adicionar uma ponte como:
# Local network interface with network connection
auto br2
iface br2 inet static
address 10.0.0.33
network 10.0.0.32
netmask 255.255.255.224
broadcast 10.0.0.63
dns-nameservers xx.xx.xx.xx xx.xx.xx.xx
bridge_ports eth0
bridge_fd 9
bridge_hello 2
bridge_maxage 12
bridge_stp off
Assim, os convidados podem estar na rede privada com uma estática, bem como conectados à internet com apenas uma interface.
Mas depois que eu reinicio o host com isso, duas pontes em eth0
e uma ponte em eth1
, o host é perdido. Não é possível fazer login com o ssh. Como o host é remoto, não consigo acessá-lo fisicamente.
Por favor ajude. Agradecemos antecipadamente.