3
votes

I don't know why but I can't ping a virtual machine node from the host. I have created a network:
vboxnet1:

IPv4 Address: 192.168.57.0
IPv4 Network Mask: 255.255.255.0
IPv6 Address: fe80:0000:0000:0000:0800:27ff:fe00:0000
IPv6 Network Mask Length: 64

Then I have created a virtual machine with 2 interfaces:
adapter 1: NAT
adapter 2: Host-only Adapter. Name: vboxnet1

Check "Cable Connected"

Then I have Installed CentOS 7 on VM.

edit: /etc/sysconfig/network-scripts/ifcfg-eth0:

DEVICE=eth0
TYPE=Ethernet
BOOTPROTO=dhcp
DEFROUTE=yes
ONBOOT=yes

edit: /etc/sysconfig/network-scripts/ifcfg-eth1:

TYPE=Ethernet
IPADDR=192.168.57.111
NETMASK=255.255.255.0
BOOTPROTO=static
IPV4_FAILURE_FATAL=no
IPV6INIT=yes
IPV6_AUTOCONF=yes
IPV6DEFROUTE=yes
IPV6_PEERDNS=yes
IPV6_PEERROUTES=yes
IPV6_FAILURE_FATAL=no
NAME=eth1
DEVICE=eth1
ONBOOT=yes

"ip addr" on VM shows that eth0 is 10.0.2.15/24 and eth1 is 192.168.57.111/24

"route -n" on host machine shows:

0.0.0.0 192.168.0.1 0.0.0.0 UG 0 0 0 wlan0
192.168.0.0 0.0.0.0 255.255.255.0 U 0 0 0 wlan0
192.168.56.0 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet0
192.168.57.0. 0.0.0.0 255.255.255.0 U 0 0 0 vboxnet1

Virtual machines can ping each other. Also, Virtual machines can ping the host machine but the host machine can't ping virtual machines.

Can somebody explain why it isn't working?

2
I have this same issue with my VM (also RHEL), and bridged networking is not a solution - I need the VM to work when the host has no "outside" network connection, and I need the VM to have a fixed IP address, so that the host can connect to the database running on the host. Is there really no solution for host-only networking?Enno
That message means the host MAC address is not in the ARP table and the host did not answer an ARP request in the time allotted.Ron Maupin

2 Answers

0
votes

I used a bridge network because security isn't a concern in my setup.

Here is a summary of tutorial in the link from @ser99.sh

Select the virtual machine that you want to connect to your network: virtual box manager

Rightclick your virtual machine and select settings --> network settings --> bridge network: enter image description here

Start up your virtual machine and select a suitable static IP address: enter image description here

Verify that you have access to other computers: virtual machine setup