Can't ping between RHEL and Window VMs

Discussions related to using VirtualBox on Linux hosts.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Can't ping between RHEL and Window VMs

Post by awsmike »

Greetings!

I am using Virtualbox 5.1.2 and have set up 3 guests VMs: 2 Windows 2012 and 1 RHEL 7.2. All three have the same network adapters: NAT for Network Adapter 1 and Internal Network (named intnet) for Network Adapter 2. I have disabled firewall on all three guests, firewalld on RHEL 7.2 and Windows Firewall on the Window boxes.

I can ping and telnet between the Windows VMs but I cannot ping or telnet to and from the RHEL VM. I'm not really an expert in networks, so I feel there may be additional steps in the Linux side.

If I run the command route I get the following output:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
default         gateway         0.0.0.0         UG    100    0        0 enp0s3
10.0.2.0        0.0.0.0         255.255.255.0   U     100    0        0 enp0s3
192.168.122.0   0.0.0.0         255.255.255.0   U     0      0        0 virbr0
I noticed the virbr0 uses an ip address similiar to those from the window vm's network adapter 2.

If I run an ifconfig -a, I noticed the additional ethernet apdater with no IP:

Code: Select all

enp0s8: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether 08:00:27:7c:83:3c  txqueuelen 1000  (Ethernet)
        RX packets 2084  bytes 647541 (632.3 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 339  bytes 56085 (54.7 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
I tried messing with nmtui but got no where.

Any additional help would be greatly appreciate as I'm trying to replicate a work environment.

If you need additional information from my side, I'd be more than happy to share!

Thanks!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

VBox NAT nor Internal will not allow the guest and host to communicate. You would need to use Bridged or Host-only to communicate between the host and guest. See chapter 6 in your user manual for details.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

Hello,

Thanks for your quick reply! Apologies if I wasn't clear in my original post, but I am not trying to communicate between the host and the guest. Only between the guests (Linux to Windows VM). It worked instantly between my 2 Windows VMs but currently stuck on my Linux VM.

Thanks!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

1) are they all using the same intnet name?
2) remove the NAT adapters until you get the guests communicating.
3) make sure that they all are in the same subnet and no gateway defined.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

1) are they all using the same intnet name? Yes
2) remove the NAT adapters until you get the guests communicating. No Change
3) make sure that they all are in the same subnet and no gateway defined. I believe based on the below:

From Linux:

Code: Select all

Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
10.0.0.50       0.0.0.0         255.255.255.255 UH        0 0          0 enp0s3
192.168.122.0   0.0.0.0         255.255.255.0   U         0 0          0 virbr0
From Windows

Code: Select all

Link-local IPv6 Address . . . . . : fe80::94d4:a899:f80f:5577%21
IPv4 Address. . . . . . . . . . . : 10.0.0.101
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :
I tried adding 0.0.0.0 to the default gateway for windows, but it refused to accept it. Since I'm not really a network person, I'm assuming they both are on the same gateway. Based on research I found, I read:
0.0.0.0 has the specific meaning "unspecified". This roughly translates to "there is none" in the context of a gateway.
The weird thing is that in Linux it comes out as a virbr0, which I believe is a virtual bridge vs. windows that it comes out as an ethernet adapter. I have another ethernet adapter in Linux but there's no IP associated to it and appears to be disconnected by default.

Ping from Windows to Linux:

Code: Select all

C:\Users\Administrator>ping 192.168.122.0

Pinging 192.168.122.0 with 32 bytes of data:
Request timed out.
Ping from Linux to Windows:

Code: Select all

# ping 10.0.0.101
connect: Network is unreachable
Thanks for your assistance, any other suggestions or troubleshooting steps to follow?

Thanks!
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

I just read this in Chapter 6:
As a security measure, by default, the Linux implementation of internal networking only allows VMs running under the same user ID to establish an internal network. However, it is possible to create a shared internal networking interface, accessible by users with different UUIds.
I believe this may be the case... looking at it now, will update if it resolves.

Thanks!
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

False alarm, the above didn't work.

Anyone else with any suggestions and troubleshooting steps would be greatly appreciated!

Thanks...
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

Ping from Windows to Linux:

Code: Select all

    C:\Users\Administrator>ping 192.168.122.0

    Pinging 192.168.122.0 with 32 bytes of data:
    Request timed out.

Code: Select all

Ping from Linux to Windows:

    # ping 10.0.0.101
    connect: Network is unreachable
Do you see these as being in the same subnet? I guess it may be better to say same address scheme.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

Ah, I reiterate the fact mentioned earlier that I'm not really a network person! I misread and thought you were referring to the subnet mask which when compared they were the same.

I read more in Chapter 6 and it mentioned:
Unless you configure the (virtual) network cards in the guest operating systems that are participating in the internal network to use static IP addresses
I know in the Linux I haven't configured anything. So I will go see how I can do that now and will report the status after I try again once they are on the same subnet. If you have any quick commands on performing that task, that'd be great!

Thanks!
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

So it looks like a little progress...

I gave the Linux Internal Network adapter an IP (100.0.0.2) with the same subnet as the Windows box.

Ping from Linux to Windows:

Code: Select all

ping 100.0.0.1
connect: Network is unreachable
Ping from Windows to Linux:

Code: Select all

C:\Users\Administrator>ping 100.0.0.2

Pinging 100.0.0.2 with 32 bytes of data:
Reply from 100.0.0.101: Destination host unreachable.
Reply from 100.0.0.2: bytes=32 time=66ms TTL=47
Reply from 100.0.0.2: bytes=32 time=64ms TTL=47
Reply from 100.0.0.2: bytes=32 time=64ms TTL=47

Ping statistics for 100.0.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 64ms, Maximum = 66ms, Average = 64ms
So more information than before, but both are saying host unreachable....
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

Code: Select all

Reply from 100.0.0.101: Destination host unreachable.
This is indicating a gateway. Since you don't have a router ( hardware or software ) it will fail.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

I'm still a bit confused, chapter 6 states:
Internal networks are created automatically as needed, i.e. there is no central configuration. Every internal network is identified simply by its name. Once there is more than one active virtual network card with the same internal network ID, the VirtualBox support driver will automatically "wire" the cards and act as a network switch.
It worked instantly with both Windows VMs communicating with each other, but Linux appears to be much more complicated than what the literature above states.

What am I missing here? Besides the... "router." What do you recommend?

Thanks...
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

Figure out where the 100.0.0.101 is configured in your guest. It has to be a configuration issue at this point.
awsmike
Posts: 16
Joined: 5. Aug 2016, 20:26

Re: Can't ping between RHEL and Window VMs

Post by awsmike »

Ah, ok... even closer now! I can almost see the light...

So, I had my Windows as 100.0.0.101 by accident, instead of 100.0.0.1 as I wanted.

Pinging from Windows to Linux:

Code: Select all

C:\Users\Administrator>ping 100.0.0.2

Pinging 100.0.0.2 with 32 bytes of data:
Reply from 100.0.0.2: bytes=32 time=65ms TTL=47
Reply from 100.0.0.2: bytes=32 time=64ms TTL=47
Reply from 100.0.0.2: bytes=32 time=64ms TTL=47
Reply from 100.0.0.2: bytes=32 time=64ms TTL=47

Ping statistics for 100.0.0.2:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% l
Approximate round trip times in milli-seconds:
    Minimum = 64ms, Maximum = 65ms, Average = 64ms
So that's good, but from Linux to Windows I still get:

Code: Select all

# ping 100.0.0.1
connect: Network is unreachable
In fact, I can't even hit google from Linux. I removed the 'Internal Network' and just left the NAT and I was able to hit google. I removed NAT and put back 'Internal Network' adapter and can't hit google. So it looks like it gets funky when 2 network adapters are in place. But even now, with just the Internal Network, I can't ping the Windows box...

any other ideas?

Thanks so far for all your help!
Perryg
Site Moderator
Posts: 34369
Joined: 6. Sep 2008, 22:55
Primary OS: Linux other
VBox Version: OSE self-compiled
Guest OSses: *NIX

Re: Can't ping between RHEL and Window VMs

Post by Perryg »

Windows by default does not allow ping so make sure ICMP is enabled in the Windows firewall. Note: disabling the firewall does not enable ICMP.

Once everything is working then you can add the VBox NAT and it should work. This is what you need to be able to reach the Internet.
Post Reply