0

I am using a Windows 10 laptop connected to the internet via Wifi. On it I run a VirtualBox with Ubuntu 20.04.5.

As I want to connect to the internet AND to the local network I plan to configure two network adaptors as layed out below. I especially want to be able to ping 8.8.8.8 and to ping a device in the local network with the IP address 192.168.200.10. On the Windows host I can ping the two addresses without any issues.

Adaptor 1 Configuration

VirtualBox Config

  • NAT
  • Adapter Type: PCnet-FAST III (AM79C973)
  • Cable connected is checked

Guest Config

  • IPv4: DHCP
  • IPv6: Automatic

enter image description here

Adapter 2 Configuration

VirtualBox Config

  • Host-Only Adapter
  • Adapter Type: PCnet-FAST III (AM79C973)
  • Cable connected is checked
  • Tools -> Host-only Network:

enter image description here

Guest Config

  • IPv4: Manual
  • IPv6: Disable

enter image description here

Results

Adapter 2 disabled

enter image description here

When I only have Network Adapter 1 enabled I can ping both addresses from the VM, 8.8.8.8 and the local device under 192.168.200.10.

Adapter 2 enabled

enter image description here

When I enable the Network Adapter 2, to which I configured a local IP address in the local network, I would expect that I also can ping both IP addresses.

But as it turns out, I only can ping 8.8.8.8, and not the IP address in the same local network, 192.168.200.10!

Questions

  1. I appreciate if a network expert can explain me in detail what is going on, ideally in lame terms, so I can understand.
  2. Also I would like to know how I can fix this problem, i.e. to configure the VM in such a way that (i) I can ping the outside world (i.e. 8.8.8.8), (ii) I can ping the device in the local network (i.e. 192.168.200.10) and (iii) to assign a fixed IP address to the VM so the VM can be pinged in the local network setup.

Thanks a lot

Additional information

ipconfig of host machine

Windows IP Configuration


Ethernet adapter Ethernet 5:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet 4:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::64a6:b4ee:7b73:aa63%10
   IPv4 Address. . . . . . . . . . . : 192.168.200.44
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . :

Wireless LAN adapter LAN-Verbindung* 3:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Wireless LAN adapter LAN-Verbindung* 4:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter Ethernet:

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::978c:ae31:388b:1086%9
   IPv4 Address. . . . . . . . . . . : 192.168.200.5
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : 192.168.200.1

Wireless LAN adapter WLAN:

   Connection-specific DNS Suffix  . :
   IPv6 Address. . . . . . . . . . . : 2a01:cb16:9:1946:333a:61e4:9de4:bd4e
   Temporary IPv6 Address. . . . . . : 2a01:cb16:9:1946:5fc:6037:3f84:8a32
   Link-local IPv6 Address . . . . . : fe80::5c2a:e902:799d:9451%8
   IPv4 Address. . . . . . . . . . . : 192.168.249.238
   Subnet Mask . . . . . . . . . . . : 255.255.255.0
   Default Gateway . . . . . . . . . : fe80::f4d8:35ff:feb4:93c5%8
                                       192.168.249.79

Ethernet adapter Bluetooth-Netzwerkverbindung:

   Media State . . . . . . . . . . . : Media disconnected
   Connection-specific DNS Suffix  . :

Ethernet adapter vEthernet (WSL):

   Connection-specific DNS Suffix  . :
   Link-local IPv6 Address . . . . . : fe80::be63:31b4:cebb:e898%64
   IPv4 Address. . . . . . . . . . . : 172.29.64.1
   Subnet Mask . . . . . . . . . . . : 255.255.240.0
   Default Gateway . . . . . . . . . :
1
  • It shouldn't be necessary to configure two adapters in order to connect the VM to the intranet and the internet. Simply making it part of your intranet, which has access to the internet, should be enough.
    – Ramhound
    Jan 31, 2023 at 13:11

1 Answer 1

0

It's not the same local network. You've created two networks, which only happen to use identical IP numbering but there is nothing that actually connects them. Unlike switch ports, multiple interfaces on a host or a router remain independent subnets by default – packets can be forwarded between them using routing (but each would need to use different addressing for routing to work), or the interfaces can be bridged together using the "bridge" feature in Windows (but I'm not sure whether it works with VirtualBox virtual interfaces).

If you want the VM to be attached to your physical Ethernet subnet (the existing 192.168.200.0/24 network), just select Bridged mode in VirtualBox (and delete the Host-Only adapter).

12
  • So you are saying I should just use ONE adaptor and make it bridged?
    – Alex
    Jan 31, 2023 at 13:18
  • In the post I'm saying that you should switch Adapter #2 from "Host-Only" to "Bridged" mode – but, yes, it would be enough to have just the "Bridged" adapter without the "NAT" one. Jan 31, 2023 at 13:22
  • It seems your suggestion does not work. I configured the VM to have only one Bridged Adaptor, and set the manual IP address to 192.168.200.100. I still can ping 8.8.8.8 but not 192.168.100.10 anymore.
    – Alex
    Jan 31, 2023 at 13:22
  • I overlooked that you have Wi-Fi and Ethernet connected to separate networks. For that to work you'll still need two adapters – #1 for internet access (either NAT or Bridged to Wi-Fi), #2 for LAN access (Bridged to Ethernet). Jan 31, 2023 at 13:24
  • 1
    I mean this parameter. The "bridged" adapter has to be bridged to something – you have to select one of the physical network interfaces that your host has. Jan 31, 2023 at 16:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .