EDITAR

EDITAR

Llevo unos días buscando la respuesta y cualquier configuración me sirve para que la red funcione.

Tengo CentOS 7 (10.120.0.57) con KVM instalado. Creé un invitado simple (10.120.0.58) vm con CentOS7 también, pero tengo algún problema con la red del invitado. El anfitrión puede acceder a Internet y puede hacer ping a la máquina invitada. El invitado también puede hacer ping al host, pero cuando hace ping a otra IP obtiene:Destino inalcanzable. Deshabilité de antemano firewalld y selinux en ambas máquinas para eliminar problemas.

El puente de mi host debería pasar tráfico porque configuré /etc/sysctl.conf (!!!)

net.ipv4.ip_forward = 1
net.ipv4.conf.all.proxy_arp = 1

En anfitrión entcpdumpPuedo ver los paquetes ICMP del invitado, pero solo son solicitudes de una manera (sin respuestas), cuando intento hacer ping a la puerta de enlace real de la red (10.120.0.1)

IP 10.120.0.58 > gateway: ICMP echo request, id 3716, seq 1, length 64
IP 10.120.0.58 > gateway: ICMP echo request, id 3716, seq 2, length 64

Si hago ping desde un invitado, por ejemplo, google.com (tcpdump del host):

 IP localhost.localdomain > 10.120.0.58: ICMP localhost.localdomain udp port domain unreachable, length 64
 IP localhost.localdomain > 10.120.0.58: ICMP localhost.localdomain udp port domain unreachable, length 64

Pero, por supuesto, el ping funciona cuando hago ping al Invitado (10.120.0.58)<=> Anfitrión(10.120.0.57):

10.120.0.58 > localhost.localdomain: ICMP echo request, id 3719, seq 8, length 64
localhost.localdomain > 10.120.0.58: ICMP echo reply, id 3719, seq 8, length 64

¿Alguien podría explicarme cuál es el problema con mi configuración de Anfitrión/Invitado?

ANFITRIÓN: ifconfig-a:

br0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.120.0.57  netmask 255.255.255.0  broadcast 10.120.0.255
        inet6 fe80::20c:29ff:fed5:14fa  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:d5:14:fa  txqueuelen 1000  (Ethernet)
        RX packets 74849  bytes 6444652 (6.1 MiB)
        RX errors 0  dropped 100  overruns 0  frame 0
        TX packets 1033  bytes 88046 (85.9 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

eno16780032: flags=4419<UP,BROADCAST,RUNNING,PROMISC,MULTICAST>  mtu 1500
        inet6 fe80::20c:29ff:fed5:14fa  prefixlen 64  scopeid 0x20<link>
        ether 00:0c:29:d5:14:fa  txqueuelen 1000  (Ethernet)
        RX packets 2975  bytes 239252 (233.6 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 164  bytes 23286 (22.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 1  (Local Loopback)
        RX packets 6  bytes 644 (644.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 6  bytes 644 (644.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0: flags=4099<UP,BROADCAST,MULTICAST>  mtu 1500
        inet 192.168.122.1  netmask 255.255.255.0  broadcast 192.168.122.255
        ether 52:54:00:9f:de:66  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

virbr0-nic: flags=4098<BROADCAST,MULTICAST>  mtu 1500
        ether 52:54:00:9f:de:66  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

vnet0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:54:00:7f:c5:c5  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 5885 overruns 0  carrier 0  collisions 0

vnet1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether fe:54:00:b0:3d:40  txqueuelen 1000  (Ethernet)
        RX packets 420  bytes 34697 (33.8 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 111762  bytes 9374955 (8.9 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

configuración br0:

DEVICE=br0
BOOTPROTO=static
TYPE=Bridge
ONBOOT=yes
IPADDR="10.120.0.57"
NETMASK="255.255.255.0"
#GATEWAY="10.120.0.1"
#DNS1="10.120.0.1"
#DNS2="8.8.8.8"
STP=yes
DELAY=0
NM_CONTROLLED=no

configuración eno16780032:

TYPE="Ethernet"
#NAME="eno16780032"
#UUID="4fc9740c-536a-4330-aab4-bdef7489582f"
DEVICE="eno16780032"
ONBOOT="yes"
NM_CONTROLLED=no
BRIDGE=br0

puente:

bridge name     bridge id               STP enabled     interfaces
br0             8000.000c29d514fa       yes             eno16780032
                                                        vnet0
                                                        vnet1
virbr0          8000.5254009fde66       yes             virbr0-nic

Anfitriones /etc/sysconfig/network:

# Created by anaconda
NETWORKING=yes
GATEWAY=10.120.0.1

Configuración de invitado eth0:

DEVICE=eth0
NAME=eth0
TYPE=Ethernet
BOOTPROTO=static
ONBOOT=yes
IPADDR="10.120.0.58"
NETMASK="255.255.255.0"
GATEWAY="10.120.0.57" (!?)
DNS1="10.120.0.57"
DNS2="8.8.8.8"

Gracias de antemano por echar un vistazo.

EDITAR

Agrego el resultado de iptables del host:

[root@localhost ~]# iptables -L -v -n -t nat
Chain PREROUTING (policy ACCEPT 59 packets, 4981 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain INPUT (policy ACCEPT 34 packets, 3619 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain OUTPUT (policy ACCEPT 2 packets, 103 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain POSTROUTING (policy ACCEPT 2 packets, 103 bytes)
 pkts bytes target     prot opt in     out     source               destination

Iptables del invitado:

[root@localhost ~]# iptables -L -v -n -t nat
Chain PREROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain POSTROUTING (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Tracepath del invitado (10.120.0.58) a 8.8.8.8:

 1?: [LOCALHOST]                                         pmtu 1500
 1:  10.120.0.58                                         3012.516ms !H
                   Resume: pmtu 1500

EDITAR2

añadoiptables -L -v -nresultados. Del anfitrión:

[root@localhost ~]# iptables -L -v -n
Chain INPUT (policy ACCEPT 162K packets, 17M bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain FORWARD (policy ACCEPT 8 packets, 476 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain OUTPUT (policy ACCEPT 3894 packets, 309K bytes)
 pkts bytes target     prot opt in     out     source               destination

De invitado:

Chain INPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination 

Chain OUTPUT (policy ACCEPT 0 packets, 0 bytes)
 pkts bytes target     prot opt in     out     source               destination

Respuesta1

Dado que conectó el dispositivo físico de su host con la máquina virtual (supongo que vnet0y/o vnet1son los dispositivos que se utilizan para la VM), tiene acceso físico a la 10.120.0.0/24red dentro de su VM.
Entonces deberías reemplazar

GATEWAY="10.120.0.57" (!?)
DNS1="10.120.0.57"

por

GATEWAY="110.120.0.1"
DNS1="10.120.0.1"

Respuesta2

Tengo exactamente el mismo problema. Parece un error en el controlador de red virtio. Para resolver el problema hice los siguientes cambios:

En Centos 7 - KVM -->

  1. Deshabilite el servicio NetworkManager en Centos 7 que ejecuta el KVM y habilite el antiguo servicio de "red".
  2. Defina su GATEWAY en /etc/sysconfig/network y realice todos los cambios necesarios en /etc/sysconfig/network-scripts/ifcfg-eth0 (o similar). Configure IPADDR, NETMASK, etc.
  3. Cambie el controlador de red virtual (a través de virt-manager) para sus máquinas invitadas.Configúrelo en 'e1000'

En tu invitado -->

  1. Haz exactamente lo mismo. Deshabilite NetworkManager y habilite el servicio de red.
  2. Este cambio puede afectar el nombre de la interfaz de red, así que verifique el nuevo nombre usando el comando #cat /proc/net/dev (centos guest)

Lo anterior funciona para mí. He pasado más de una semana para encontrar una solución.

información relacionada