主机无法ping VM Guest

时间:2018-03-20 17:00:52

标签: linux centos virtualbox

我无法从我的主机ping我的来宾VM。

  • 主持人:Win7
  • VirtualBox 5.2.6
  • 嘉宾:CentOS 7

在VB上,我的guest虚拟机CentOS 7网络配置了2个适配器。

  • 适配器1连接到NAT
  • 适配器2连接到仅限主机的适配器(VirtualBox仅限主机的以太网适配器)

enter image description here

在CentOS 7上

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
    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: enp0s3: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:e3:8c:8f brd ff:ff:ff:ff:ff:ff
    inet 10.0.2.15/24 brd 10.0.2.255 scope global dynamic enp0s3
       valid_lft 84885sec preferred_lft 84885sec
    inet6 fe80::db4c:7b23:6a34:d832/64 scope link 
       valid_lft forever preferred_lft forever
3: enp0s8: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
    link/ether 08:00:27:0b:4f:5d brd ff:ff:ff:ff:ff:ff
4: virbr0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN qlen 1000
    link/ether 52:54:00:99:20:1b 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
5: virbr0-nic: <BROADCAST,MULTICAST> mtu 1500 qdisc pfifo_fast master virbr0 state DOWN qlen 1000
    link/ether 52:54:00:99:20:1b brd ff:ff:ff:ff:ff:ff

我认为virbr0 192.168.122.1很奇怪。我原以为192.168.56.XXX。

的ifcfg-enp0s3

TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=dhcp
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6_DEFROUTE=yes
IPV6_FAILURE_FATAL=no
IPV6_ADDR_GEN_MODE=stable-privacy
NAME=enp0s3
UUID=d36ec069-6fa5-429f-a89b-debf35c2346e
DEVICE=enp0s3
ONBOOT=yes

在我的主机上Win 7我ping 192.168.122.1并获得连接超时。有谁知道我错过了什么?

1 个答案:

答案 0 :(得分:1)

virbr0是由cent操作系统创建的虚拟网络适配器。这是由于您选择的安装类型(工作站选项)而创建的。你应该关掉这个适配器。我相信enp0s3是唯一的主机适配器,目前没有IP分配给它。启动enp0s3以建立连接。