Second physical network adapter

Discussions related to using VirtualBox on Linux hosts.
Post Reply
Spanky
Posts: 3
Joined: 4. Oct 2021, 22:37

Second physical network adapter

Post by Spanky »

I have Virtualbox running on Linux Mint. The host has two physical network adapters.

I want to use both of these physical network adapters in my Windows 10 guest machine.
The first adapter has an address of 192.168.1.xxx, assigned by DHCP, and is connected to my office network.
The second adapter will have a static address of 192.168.100.x, and will be connected to a second physical switch, with has 4 other devices with static addresses of 192.168.100.x.

My goal is to have total physical isolation between the 100.x devices and the office network.

In Mint, I have gone into the advanced network configuration for adapter #2 and unchecked "connect automatically" in the general tab. Adapter #2 is enabled and set to "bridged" in the guest configuration.

In the guest, I have assigned a static IP address of 192.168.100.5
The first device I want it to connect to has a static address of 192.168.100.6.

If I plug the device 100.6 into the office switch, I can ping it from the guest, forcing it to use the 100.5 adapter "ping -S 192.168.100.5 192.168.100.6", but that works whether or not adapter #2 is plugged into that switch, so it seems to me adapter #2 is a virtual adapter, not the physical adapter. If I plug the 100.6 device and adapter #2 into the second switch, I cannot ping it.

I hope this explanation makes sense. What am I doing wrong?
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Second physical network adapter

Post by scottgus1 »

Spanky wrote:In Mint, I have gone into the advanced network configuration for adapter #2 and unchecked "connect automatically" in the general tab.
For what purpose was this setting made? Maybe it is interfering with the ability of the devices on the private switch to connect.
Spanky wrote:My goal is to have total physical isolation between the 100.x devices and the office network.
If the mask is set so the .1 and .100 networks are mutually blocked (255.255.255.0 masks on both) then they can both exist on one set of network hardware but not communicate with each other.

With two separate networks in the computer (as with your two Ethernet adapters, and sufficiently masked IP ranges) the two networks will be even more separated and not communicate with each other, unless you manually add a host OS "bridge" (note this "bridge" is not Virtualbox Bridged). Just like Virtualbox Host-Only cannot communicate with the physical network.

I'd leave both network adapters with separate IP ranges in "automatic" mode so normal comms can happen. Let both host adapters be Virtualbox Bridged to the VM, let both adapters "connect automatically". Set each adapter in the VM to the appropriate separate IP range and mask. As long as you don't make a Windows "bridge" inside the VM's OS, the two separate networks should remain separate.
Spanky
Posts: 3
Joined: 4. Oct 2021, 22:37

Re: Second physical network adapter

Post by Spanky »

Thank you for the advice. I tried that, and it still works the same way.

If I leave adapter #2 (which has been statically assigned 192.168.100.5(in the VM)) completely unplugged, then plug the 100.6 device into the primary/office switch, where adapter #1 (192.168.1.x (in the VM)) is plugged in, I can still ping it using:
ping -S 192.168.100.5 192.168.100.6

So it appears that having adapter #2 enabled in the VM settings just sets physical adapter #1 up as 2 virtual adapters. Physical adapter #2 is not being used? Is there some way to force adapter #2 to be used?
Maybe what I'm trying just isn't possible, or maybe I just don't know what I'm doing!
Spanky
Posts: 3
Joined: 4. Oct 2021, 22:37

Re: Second physical network adapter

Post by Spanky »

Problem solved. Turns out the dumb guy at the keyboard didn't see the simple drop down in the ethernet configuration to pick which interface it uses.
scottgus1
Site Moderator
Posts: 20965
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: Second physical network adapter

Post by scottgus1 »

Ah, yes, good ol' Mr. Pebcak! :lol:

I had a good feeling it was supposed to work, was going to try an experiment on it tonight.

Glad you got it going!
Post Reply