Por que não consigo acessar a máquina host dentro do meu vm?

0

Host: cent os 7

ip: 192.168.1.3/24 rota padrão: 192.168.1.1

interface virtual ip: virbro: 192.168.4.0/24 gateway: 192.168.4.2

ip a no host

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN 
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever
2: eno1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether c0:3f:d5:66:c3:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.3/24 brd 192.168.1.255 scope global dynamic eno1
       valid_lft 62703sec preferred_lft 62703sec
    inet6 fe80::c23f:d5ff:fe66:c301/64 scope link 
       valid_lft forever preferred_lft forever
3: wlp2s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state UP qlen 1000
    link/ether ac:fd:ce:03:2c:58 brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.2/24 brd 192.168.1.255 scope global dynamic wlp2s0
       valid_lft 62549sec preferred_lft 62549sec
    inet6 fe80::aefd:ceff:fe03:2c58/64 scope link 
       valid_lft forever preferred_lft forever
4: ham0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1404 qdisc pfifo_fast state UNKNOWN qlen 500
    link/ether 7a:79:19:5c:7b:fd brd ff:ff:ff:ff:ff:ff
    inet 25.92.123.253/8 brd 25.255.255.255 scope global ham0
       valid_lft forever preferred_lft forever
    inet6 2620:9b::195c:7bfd/96 scope global 
       valid_lft forever preferred_lft forever
    inet6 fe80::7879:19ff:fe5c:7bfd/64 scope link 
       valid_lft forever preferred_lft forever
5: virbr0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 52:54:00:35:f6:c9 brd ff:ff:ff:ff:ff:ff
    inet 192.168.4.0/24 brd 192.168.4.255 scope global virbr0
       valid_lft forever preferred_lft forever
    inet 192.168.4.3/24 scope global secondary virbr0
       valid_lft forever preferred_lft forever
6: virbr0-nic: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 500
    link/ether 52:54:00:35:f6:c9 brd ff:ff:ff:ff:ff:ff

ip r no host

[root@centos services]# ip r
default via 192.168.1.1 dev eno1  proto static  metric 100 
default via 192.168.1.1 dev wlp2s0  proto static  metric 600 
25.0.0.0/8 dev ham0  proto kernel  scope link  src 25.92.123.253 
192.168.1.0/24 dev eno1  proto kernel  scope link  src 192.168.1.3  metric 100 
192.168.1.0/24 dev wlp2s0  proto kernel  scope link  src 192.168.1.2  metric 600 
192.168.4.0/24 dev virbr0  proto kernel  scope link  src 192.168.4.0 

similarmente para o convidado: cent os 7

ip: 192.168.4.200/24 rota padrão: 192.168.4.2

ip a e ip r no convidado

Eu não consigo pingar o host (192.168.1.3) da vm (192.168.4.200) também, me dá destino host inacessível.

EDIT: acabou de instalar o windows em como vm guest e capaz de pingar o convidado dele.

convidado do windows:

 Link-local IPv6 Address . . . . . : fe80::7085:b96
 IPv4 Address. . . . . . . . . . . : 192.168.4.104
 Subnet Mask . . . . . . . . . . . : 255.255.255.0
 Default Gateway . . . . . . . . . : 192.168.4.0

:\Users\IEUser>ping 192.168.1.3

inging 192.168.1.3 with 32 bytes of data:
eply from 192.168.1.3: bytes=32 time<1ms TTL=64
eply from 192.168.1.3: bytes=32 time<1ms TTL=64
eply from 192.168.1.3: bytes=32 time<1ms TTL=64
eply from 192.168.1.3: bytes=32 time<1ms TTL=64

ing statistics for 192.168.1.3:
   Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

host:

    
por munish 23.10.2016 / 20:46

1 resposta

0

Você precisa adicionar ip ao nic virtual da máquina host.

ip a a 192.168.4.3/24 dev virbr0

e que acessam a máquina host do convidado nesse ip (192.168.4.3)

Para corrigir os dois problemas de uma vez, verifique se você ativou o NAT no hipervisor da VM. Eu esperaria que o gateway padrão do sistema operacional convidado fosse 192.168.4.1. Tente mudar isso com

ip r d default via 192.168.4.2
ip r a default via 192.168.4.1

Se isso não funcionar, envie os resultados dos seguintes comandos para os dois sistemas:

ip a
ip r
    
por 24.10.2016 / 01:21

Tags