Eu estou tentando adicionar três interfaces a um convidado KVM (exigido pelo meu provedor de hospedagem) e ter pouca sorte! Eu posso conseguir apenas um de cada vez para trabalhar no convidado. Se eu ativar um adaptador dentro de nmtui
enquanto desabilitar outros no convidado do CentOS 7, ele funcionará, mas outros adaptadores não farão mais o ping. Eu acredito que há um problema com o meu entendimento sobre como funciona a ponte e gostaria de alguns ponteiros.
Objetivo: configurar uma ponte no Host e três interfaces no Guest (o provedor do servidor atribui endereços MAC para eu usar)
Informação:
xxx.yyy.107.27 - assume main IP address of the Host machine
xxx.yyy.107.1 - gateway for the above
255.255.255.192 - netmask for the above
xxx.yyy.168.170 - IP address #1 for Guest
xxx.yyy.168.171 - IP address #2 for Guest
xxx.yyy.168.174 - IP address #3 for Guest
xxx.yyy.168.169 - Gateway for IPs 1-3 given by Provider
255.255.255.248 - Netmask for IPs 1-3 given by Provider
00:50:56:00:a4:33 - MAC for IP 1
00:50:56:00:9a:97 - MAC for IP 2
00:50:56:00:ad:04 - MAC for IP 3
Debian 8 host / etc / network / interfaces:
# Loopback device:
auto lo
iface lo inet loopback
# eth0
auto eth0
iface eth0 inet manual
iface eth0 inet6 static
address 2a01:4f8:171:101a::2
netmask 64
gateway fe80::1
auto br0
iface br0 inet static
address xxx.yyy.107.27
netmask 255.255.255.192
gateway xxx.yyy.107.1
broadcast xxx.yyy.107.63
bridge_ports eth0
bridge_fd 0
bridge_stp off
bridge_waitport 0
bridge_hello 2
bridge_maxage 12
A rede Libvirt:
<network>
<name>Host</name>
<forward mode='bridge'/>
<bridge name='br0'/>
</network>
A configuração XML do Guest referente às interfaces:
<interface type='network'>
<mac address='00:50:56:00:a4:33'/>
<source network='Host'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/>
</interface>
<interface type='network'>
<mac address='00:50:56:00:9a:97'/>
<source network='Host'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x07' function='0x0'/>
</interface>
<interface type='network'>
<mac address='00:50:56:00:ad:04'/>
<source network='Host'/>
<model type='rtl8139'/>
<address type='pci' domain='0x0000' bus='0x00' slot='0x08' function='0x0'/>
</interface>
Convidado do CentOS 7 / etc / sysconfig / interfaces de rede / ifcfg-eth0-1:
HWADDR=00:50:56:00:A4:33
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
NAME=eth0
UUID=18f3808e-335a-4932-93e4-683b987ddc07
DEVICE=eth0
ONBOOT=yes
PREFIX=32
PEERDNS=yes
PEERROUTES=yes
Convidado do CentOS 7 / etc / sysconfig / interfaces de rede / ifcfg-eth1:
HWADDR=00:50:56:00:9A:97
TYPE=Ethernet
BOOTPROTO=dhcp
DNS1=213.133.98.98
DNS2=213.133.99.99
DNS3=213.133.100.100
DEFROUTE=no
IPV4_FAILURE_FATAL=yes
IPV6INIT=yes
IPV6_AUTOCONF=no
IPV6_DEFROUTE=no
IPV6_FAILURE_FATAL=no
NAME=eth1
UUID=a2c6c1e3-bfb2-4401-99e0-40f723d6d713
DEVICE=eth1
ONBOOT=yes
PEERDNS=yes
PEERROUTES=yes
Não vejo nenhum arquivo para a terceira interface, algo relacionado ao Network Manager?
Convidado / etc / sysconfig / network:
GATEWAY=xxx.yyy.107.1
route -n output on Guest:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 xxx.yyy.168.169 0.0.0.0 UG 100 0 0 ens8
0.0.0.0 xxx.yyy.168.169 0.0.0.0 UG 101 0 0 eth0
xxx.yyy.168.168 0.0.0.0 255.255.255.248 U 100 0 0 ens8
xxx.yyy.168.169 0.0.0.0 255.255.255.255 UH 100 0 0 eth0
xxx.yyy.168.170 0.0.0.0 255.255.255.255 UH 100 0 0 eth0
188.40.24.199 xxx.yyy.168.169 255.255.255.255 UGH 100 0 0 ens8
route -n output no host:
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
0.0.0.0 xxx.yyy.107.1 0.0.0.0 UG 0 0 0 br0
xxx.yyy.107.0 0.0.0.0 255.255.255.192 U 0 0 0 br0
Parece que a minha bridge permite que apenas uma dessas interfaces chegue ao mundo externo a qualquer momento. Gostaria de corrigir isso, mas não tenho certeza se tenho a configuração & compreensão correta. Eu provavelmente configurei tudo muito errado e coisas estranhas estão acontecendo, então aprecie qualquer ajuda.
EDIT 1:
Estado atual das coisas no ifconfig do convidado:
ens8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.yyy.168.174 netmask 255.255.255.248 broadcast xxx.yyy.168.175
inet6 fe80::250:56ff:fe00:ad04 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:00:ad:04 txqueuelen 1000 (Ethernet)
RX packets 6456 bytes 3735538 (3.5 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 4987 bytes 548563 (535.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.yyy.168.170 netmask 255.255.255.248 broadcast xxx.yyy.168.170
inet6 fe80::250:56ff:fe00:a433 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:00:a4:33 txqueuelen 1000 (Ethernet)
RX packets 1012 bytes 75375 (73.6 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 47 bytes 5110 (4.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
eth1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet xxx.yyy.168.171 netmask 255.255.255.248 broadcast xxx.yyy.168.175
inet6 fe80::250:56ff:fe00:9a97 prefixlen 64 scopeid 0x20<link>
ether 00:50:56:00:9a:97 txqueuelen 1000 (Ethernet)
RX packets 1048 bytes 77065 (75.2 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 22 bytes 2808 (2.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 0 (Local Loopback)
RX packets 12243 bytes 1881497 (1.7 MiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 12243 bytes 1881497 (1.7 MiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
Agora, apenas xxx.yyy.168.170 é acessível de fora do convidado. O resto nem está no host.
ifconfig do host:
br0 Link encap:Ethernet HWaddr f8:32:e4:71:a2:87
inet addr:xxx.yyy.107.27 Bcast:xxx.yyy.107.63 Mask:255.255.255.192
inet6 addr: fe80::fa32:e4ff:fe71:a287/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:20661927 errors:0 dropped:0 overruns:0 frame:0
TX packets:14207667 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:3370784779 (3.1 GiB) TX bytes:2529369626 (2.3 GiB)
eth0 Link encap:Ethernet HWaddr f8:32:e4:71:a2:87
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:22402779 errors:0 dropped:0 overruns:0 frame:0
TX packets:15423843 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4010564000 (3.7 GiB) TX bytes:2731403072 (2.5 GiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:21145 errors:0 dropped:0 overruns:0 frame:0
TX packets:21145 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:2619801 (2.4 MiB) TX bytes:2619801 (2.4 MiB)
vnet0 Link encap:Ethernet HWaddr fe:50:56:00:a4:33
inet6 addr: fe80::fc50:56ff:fe00:a433/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:2028 errors:0 dropped:0 overruns:0 frame:0
TX packets:7634 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:1219855 (1.1 MiB) TX bytes:692099 (675.8 KiB)
vnet1 Link encap:Ethernet HWaddr fe:50:56:00:9a:97
inet6 addr: fe80::fc50:56ff:fe00:9a97/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:49 errors:0 dropped:0 overruns:0 frame:0
TX packets:6348 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:5154 (5.0 KiB) TX bytes:520891 (508.6 KiB)
vnet2 Link encap:Ethernet HWaddr fe:50:56:00:ad:04
inet6 addr: fe80::fc50:56ff:fe00:ad04/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:5080 errors:0 dropped:0 overruns:0 frame:0
TX packets:12829 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:500
RX bytes:560230 (547.0 KiB) TX bytes:4342111 (4.1 MiB)