¿Cómo permitir que mi VM conecte la red?

4

En mi Mac, uso VMware Fusion, he creado una máquina virtual, el ifconfig de mi Mac es el siguiente:

aircraftdeMacBook-Pro:.ssh ldl$ ifconfig 
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> mtu 16384
    options=1203<RXCSUM,TXCSUM,TXSTATUS,SW_TIMESTAMP>
    inet 127.0.0.1 netmask 0xff000000 
    inet6 ::1 prefixlen 128 
    inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 
    nd6 options=201<PERFORMNUD,DAD>
gif0: flags=8010<POINTOPOINT,MULTICAST> mtu 1280
stf0: flags=0<> mtu 1280
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether a0:99:9b:17:50:07 
    inet6 fe80::8e2:5999:6f70:e3f5%en0 prefixlen 64 secured scopeid 0x4 
    inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
en1: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 4a:00:02:2c:3b:30 
    media: autoselect <full-duplex>
    status: inactive
en2: flags=963<UP,BROADCAST,SMART,RUNNING,PROMISC,SIMPLEX> mtu 1500
    options=60<TSO4,TSO6>
    ether 4a:00:02:2c:3b:31 
    media: autoselect <full-duplex>
    status: inactive
p2p0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> mtu 2304
    ether 02:99:9b:17:50:07 
    media: autoselect
    status: inactive
awdl0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> mtu 1484
    ether 7e:0a:8c:55:bc:b4 
    inet6 fe80::7c0a:8cff:fe55:bcb4%awdl0 prefixlen 64 scopeid 0x8 
    nd6 options=201<PERFORMNUD,DAD>
    media: autoselect
    status: active
bridge0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    options=63<RXCSUM,TXCSUM,TSO4,TSO6>
    ether 4a:00:02:2c:3b:30 
    Configuration:
        id 0:0:0:0:0:0 priority 0 hellotime 0 fwddelay 0
        maxage 0 holdcnt 0 proto stp maxaddr 100 timeout 1200
        root id 0:0:0:0:0:0 priority 0 ifcost 0 port 0
        ipfilter disabled flags 0x2
    member: en1 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 5 priority 0 path cost 0
    member: en2 flags=3<LEARNING,DISCOVER>
            ifmaxaddr 0 port 6 priority 0 path cost 0
    nd6 options=201<PERFORMNUD,DAD>
    media: <unknown type>
    status: inactive
utun0: flags=8051<UP,POINTOPOINT,RUNNING,MULTICAST> mtu 2000
    inet6 fe80::5f08:8c57:f439:8b6%utun0 prefixlen 64 scopeid 0xa 
    nd6 options=201<PERFORMNUD,DAD>
vmnet1: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:50:56:c0:00:01 
    inet 172.16.111.1 netmask 0xffffff00 broadcast 172.16.111.255
vmnet8: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
    ether 00:50:56:c0:00:08 
    inet 192.168.220.1 netmask 0xffffff00 broadcast 192.168.220.255

Y en mi VM, el ip a es así:

[root@localhost yangmi]# ip a
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: eno16777736: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:47:93:4b brd ff:ff:ff:ff:ff:ff
    inet 192.168.1.25/24 brd 192.168.1.255 scope global eno16777736
       valid_lft forever preferred_lft forever
    inet6 fe80::20c:29ff:fe47:934b/64 scope link 
       valid_lft forever preferred_lft forever
3: eno33554992: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:50:56:26:58:01 brd ff:ff:ff:ff:ff:ff
    inet 192.168.220.129/24 brd 192.168.220.255 scope global dynamic eno33554992
       valid_lft 1688sec preferred_lft 1688sec
    inet6 fe80::250:56ff:fe26:5801/64 scope link 
       valid_lft forever preferred_lft forever
4: eno50332216: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 00:0c:29:47:93:5f brd ff:ff:ff:ff:ff:ff
    inet 192.168.220.130/24 brd 192.168.220.255 scope global dynamic eno50332216
       valid_lft 1688sec preferred_lft 1688sec
    inet6 fe80::20c:29ff:fe47:935f/64 scope link 
       valid_lft forever preferred_lft forever
5: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN 
    link/ether 00:00:00:00:00:00 brd ff:ff:ff:ff:ff:ff
    inet 192.168.122.1/24 brd 192.168.122.255 scope global virbr0
       valid_lft forever preferred_lft forever
6: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast state DOWN qlen 500
    link/ether 52:54:00:4a:68:e5 brd ff:ff:ff:ff:ff:ff

ves que eno16777736 ip es 192.168.1.25/24 , es la misma WLAN con la interfaz en0 de mi Mac.

Pero en la máquina virtual, no puedo ping la ip de baidu:

[root@localhost yangmi]# ping 220.181.57.217
PING 220.181.57.217 (220.181.57.217) 56(84) bytes of data.
From 192.168.1.25 icmp_seq=1 Destination Host Unreachable
From 192.168.1.25 icmp_seq=2 Destination Host Unreachable
From 192.168.1.25 icmp_seq=3 Destination Host Unreachable
From 192.168.1.25 icmp_seq=4 Destination Host Unreachable
From 192.168.1.25 icmp_seq=5 Destination Host Unreachable
From 192.168.1.25 icmp_seq=6 Destination Host Unreachable
From 192.168.1.25 icmp_seq=7 Destination Host Unreachable

¿Cómo puedo usar la máquina virtual para conectar la red?

El sistema de mi host es: macOS Sierra 10.12.2
El sistema de mi VM es: CentOS 7.2

EDIT

Uso el ip route show :

[root@localhost yangmi]# ip route show
default via 192.168.1.1 dev eno16777736 
default via 192.168.220.2 dev eno33554992  proto static  metric 100 
default via 192.168.220.2 dev eno50332216  proto static  metric 101 
169.254.0.0/16 dev eno16777736  scope link  metric 1002 
192.168.1.0/24 dev eno16777736  proto kernel  scope link  src 192.168.1.25 
192.168.122.0/24 dev virbr0  proto kernel  scope link  src 192.168.122.1 
192.168.220.0/24 dev eno33554992  proto kernel  scope link  src 192.168.220.129  metric 100 
192.168.220.0/24 dev eno50332216  proto kernel  scope link  src 192.168.220.130  metric 101 

EDIT -2

Utilizo el comando traceroute para obtener la siguiente información:

[yangmi@localhost ~]$ traceroute 220.181.57.217
traceroute to 220.181.57.217 (220.181.57.217), 30 hops max, 60 byte packets
 1  192.168.1.25 (192.168.1.25)  3006.884 ms !H  3006.653 ms !H  3006.635 ms !H

EDIT -3

En el /etc/sysconfig/network-scripts/ , solo hay una interfaz de red, pero en la parte superior ves que uso ip a tengo tres:

[yangmi@localhost network-scripts]$ ls
ifcfg-eno16777736  ifdown-ppp       ifup-ib      ifup-Team
ifcfg-lo           ifdown-routes    ifup-ippp    ifup-TeamPort
ifdown             ifdown-sit       ifup-ipv6    ifup-tunnel
ifdown-bnep        ifdown-Team      ifup-isdn    ifup-wireless
ifdown-eth         ifdown-TeamPort  ifup-plip    init.ipv6-global
ifdown-ib          ifdown-tunnel    ifup-plusb   network-functions
ifdown-ippp        ifup             ifup-post    network-functions-ipv6
ifdown-ipv6        ifup-aliases     ifup-ppp
ifdown-isdn        ifup-bnep        ifup-routes
ifdown-post        ifup-eth         ifup-sit
    
pregunta aircraft 07.07.2017 - 11:47

1 respuesta

3

Su máquina virtual CentOS está configurada con tres interfaces de red (Ethernet) en VMware:

En su sistema Linux aparecen como:

  • eno16777736 (una interfaz conectada a la interfaz Wi-Fi física de su Mac en0)
  • eno33554992 (una interfaz conectada a vmnet8 de su Mac="Compartir con mi Mac"
  • eno50332216 (una segunda interfaz conectada a vmnet8 de su Mac="Compartir con mi Mac"

vmnet1 / vmnet8 son dispositivos de red virtual creados por VMware Fusion y proporcionan una red solo para el host y NAT a las máquinas virtuales.

Ahora su servidor Linux tiene NAT dos veces en su red 192.168.1.0/24 a través de vmnet8 y al mismo tiempo está en la red 192.168.1.0/24 al mismo tiempo, lo cual es un poco exagerado y causa problemas de enrutamiento en su entorno.

Así que apaga la VM y elimina las dos interfaces "Compartir con mi Mac" en la configuración > Los dispositivos extraíbles de la máquina virtual CentOS o eliminan la interfaz puenteada y una de las interfaces "Compartir con mi Mac". El procedimiento a elegir / ruta a seguir depende del propósito de la VM.

    
respondido por el klanomath 08.07.2017 - 05:05

Lea otras preguntas en las etiquetas