Network Issues

Discussions about using Linux guests in VirtualBox.
Post Reply
eng3
Posts: 12
Joined: 1. Apr 2020, 17:11

Network Issues

Post by eng3 »

I'm running W10 on my laptop with the latest VB installed. I installed a new debian 10 guest, minimal install. NAT setup with port 22 forwarded. No firewall installed. I did not get a chance to install any common tools (ie. net-tools) yet.

1. I cannot get SSH to work. In the guest, I can SSH to myself. From the Host, I cannot SSH, it just times out. It is strange as I have it setup exactly the same on another computer and it works fine.
2. Internet access worked fine until I changed WIFI networks. DNS does not seem to work. I can ping the DNS server, but any attempt to access a website times out.

In the VM log, I see:

00:00:18.130180 NAT: Link up
00:00:19.424766 NAT: DHCP offered IP address 10.0.2.15

On the guest, in network manager, it has a 10.0.2.15 IP address and is able to get DNS servers matching what I have on the host. /etc/resolv.conf has the correct servers
I have tried rebooting the VM. I've tried turning off the firewall on the host.


/etc/resolv.conf:

nameserver 1.1.1.1

ping 1.1.1.1 works

11:38:39.397764 IP 10.0.2.15 > 1.1.1.1: ICMP echo request, id 2960, seq 2, length 64
11:38:39.436573 IP 1.1.1.1 > 10.0.2.15: ICMP echo reply, id 2960, seq 2, length 64

dig @1.1.1.1 google.com does not work

11:38:43.814134 IP 10.0.2.15.50821 > 1.1.1.1.53: 29800+ [1au] A? google.com. (51)
11:38:43.814861 IP 10.0.2.2 > 10.0.2.15: ICMP net 1.1.1.1 unreachable, length 36
11:38:45.697058 IP 10.0.2.15.50263 > 172.30.0.27.53: 32978+ AAAA? clients3.google.com. (37)
11:38:45.697650 IP 10.0.2.15.46410 > 172.30.0.27.53: 56459+ A? clients3.google.com. (37)
11:38:45.698116 IP 10.0.2.2 > 10.0.2.15: ICMP net 172.30.0.27 unreachable, length 36
11:38:45.698446 IP 10.0.2.2 > 10.0.2.15: ICMP net 172.30.0.27 unreachable, length 36
11:38:48.814785 IP 10.0.2.15.50821 > 1.1.1.1.53: 29800+ [1au] A? google.com. (51)
11:38:48.816463 IP 10.0.2.2 > 10.0.2.15: ICMP net 1.1.1.1 unreachable, length 36
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Network Issues

Post by fth0 »

eng3 wrote:I've tried turning off the firewall on the host.
I think that either you didn't succeed, or you've other security software running on your host OS.
eng3
Posts: 12
Joined: 1. Apr 2020, 17:11

Re: Network Issues

Post by eng3 »

fth0 wrote:
eng3 wrote:I've tried turning off the firewall on the host.
I think that either you didn't succeed, or you've other security software running on your host OS.
I dont have anything else that I know of. And the problem seems to vary based on network.
For example, at home it has always worked. Also, when I connect via my cellphone hotspot.
At my current hotel, it did not work. I went to an office and went on their WIFI and it wouldnt work.
I'm not back at my hotel and it suddenly works. I tried it on my cellphone and it doesnt.

All I seem to be able to decipher is that the ICMP is being blocked (though ping works)


Also, I havent gotten SSH to work at all
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Network Issues

Post by fth0 »

Please provide the IP configuration of the host (ipconfig /all) and the guest (ifconfig; route -n), and the SSH command line.
eng3
Posts: 12
Joined: 1. Apr 2020, 17:11

Re: Network Issues

Post by eng3 »

regarding the second issue, I've noticed some strange patterns
At home it works fine. When I connect to my cellphone hotspot while at home everything worked too. At my hotel, at first it would not work. Then trying at my remote office guest wifi network, it also would not work. Then trying my cellphone hotspot mode, it also would not work. However, upon returning back to my hotel, it suddenly worked. I have the exact same pattern with trying to connect my wireguard vpn. Note back at the hotel, once I connect the vpn, dns stops working, it is unable to contact the dns server on my vpn, eventhough the host is able to.
virtualbox sees the network changes, debian updates the network configuration, I can ping addresses outside, but dns fails with the ICMP issue. I've noticed that the DNS issue is ok if I switch to a bridged network. Unfortunately, some networks will only give me one IP so getting it to work with NAT is preferred.


host ip:

Code: Select all

Windows IP Configuration

   Host Name . . . . . . . . . . . . : mobile-host
   Primary Dns Suffix  . . . . . . . : 
   Node Type . . . . . . . . . . . . : Hybrid
   IP Routing Enabled. . . . . . . . : No
   WINS Proxy Enabled. . . . . . . . : No
   DNS Suffix Search List. . . . . . : domain.com

Wireless LAN adapter Wi-Fi:

   Connection-specific DNS Suffix  . : domain.com
   Description . . . . . . . . . . . : Intel(R) Dual Band Wireless-AC 8260
   Physical Address. . . . . . . . . : xx-xx-xx
   DHCP Enabled. . . . . . . . . . . : Yes
   Autoconfiguration Enabled . . . . : Yes
   Link-local IPv6 Address . . . . . : fe80::144a:9283:6efc:e688%6(Preferred) 
   IPv4 Address. . . . . . . . . . . : 172.30.67.77(Preferred) 
   Subnet Mask . . . . . . . . . . . : 255.255.255.128
   Lease Obtained. . . . . . . . . . : Tuesday, June 9, 2020 6:13:32 AM
   Lease Expires . . . . . . . . . . : Tuesday, June 9, 2020 8:13:31 AM
   Default Gateway . . . . . . . . . : 172.30.67.1
   DHCP Server . . . . . . . . . . . : 1.1.1.1
   DHCPv6 IAID . . . . . . . . . . . : 249869080
   DHCPv6 Client DUID. . . . . . . . : xxxx
   DNS Servers . . . . . . . . . . . : 172.30.0.27
   NetBIOS over Tcpip. . . . . . . . : Enabled


guest
ifconfig; route -n

Code: Select all

enp0s3: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 10.0.2.15  netmask 255.255.255.0  broadcast 10.0.2.255
        ether 08:00:27:25:3c:57  txqueuelen 1000  (Ethernet)
        RX packets 40838  bytes 31699646 (30.2 MiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 27520  bytes 2854115 (2.7 MiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
0.0.0.0         10.0.2.2        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
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 enp0s3
/etc/resolv.conf

Code: Select all

nameserver 172.30.0.27
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Network Issues

Post by fth0 »

eng3 wrote:

Code: Select all

  DHCP Server . . . . . . . . . . . : 1.1.1.1
You're in a wireless network with a local DHCP server using 1.1.1.1, so that the primary Cloudflare DNS server at 1.1.1.1 is not reachable. If you're not in control of the DHCP server, use the secondary Cloudflare DNS server at 1.0.0.1.
eng3
Posts: 12
Joined: 1. Apr 2020, 17:11

Re: Network Issues

Post by eng3 »

fth0 wrote:
eng3 wrote:

Code: Select all

  DHCP Server . . . . . . . . . . . : 1.1.1.1
You're in a wireless network with a local DHCP server using 1.1.1.1, so that the primary Cloudflare DNS server at 1.1.1.1 is not reachable. If you're not in control of the DHCP server, use the secondary Cloudflare DNS server at 1.0.0.1.
I've tried that and it still does not work.
1.1.1.1 is one that I manually added. The one the DHCP assigned is 172.30.0.27. It should work with that one anyways.
fth0
Volunteer
Posts: 5678
Joined: 14. Feb 2019, 03:06
Primary OS: Mac OS X other
VBox Version: PUEL
Guest OSses: Linux, Windows 10, ...
Location: Germany

Re: Network Issues

Post by fth0 »

Ok. It wasn't clear to me that you use the DNS server provided from the DHCP server inside the guest OS, and not 1.1.1.1.

I can only assess the situation from the information you give to me. Lately, you started mentioning a VPN, what role does that play in your network setup? Anything else network related that you forgot to mention? Also, you seem to have missed the SSH question.

Generally, you could use Wireshark on your host to capture all network traffic at the WiFi adapter, and see if the DNS traffic leaves the host.
eng3
Posts: 12
Joined: 1. Apr 2020, 17:11

Re: Network Issues

Post by eng3 »

Sorry for the confusion. When DNS was not working, I tried adding one manually to the list (ie. 1.1.1.1, 1.0.0.1, etc). I only mention VPN as an additional potential clue.

Right now, it works at my hotel wifi (but not if I connect my VPN and try use use the vpn wifi). It does not work when connected to my office guest wifi or via hotspot. VPN also wont connect while connected to my office guest wifi or hotspot.

DNS always works on the host.

It works in bridged mode but there is limited testing as I can't always get another IP.

At first, it seemed like this was an issue with virtualbox blocking something because it works on the host but not guest and bridged mode works. However, it does not make sense that it works on some networks but not others.

I'll try to see what kind of logging I can do on the host to try to see if its getting out of the VM.
Post Reply