Can I connect VM's to two different subnets using a single physical NIC?

Discussions related to using VirtualBox on Linux hosts.
Post Reply
robertb1
Posts: 13
Joined: 12. Sep 2017, 19:51

Can I connect VM's to two different subnets using a single physical NIC?

Post by robertb1 »

Hello, brand new here. I tried to search for an answer to this question on this forum but couldn't find one.

I have virtualbox running on a Ubuntu 16.04 64 bit host. I have four VM's running (all Ubuntu 16.04) with static ip addresses, of which one is an OpenVPN server. All VM's are configured with bridged networking. I am NATting my public addresses to each VM via its private address. I am unable to connect to my email, cloud, or web server via their public addresses while connected to the vpn. I was advised on the Ubiquiti EdgeMax forum that my vpn server needs to be on a different private subnet than my other servers. Right now everything is on the 192.168.1.0/24 subnet, I need to move my vpn server to 192.168.2.0/24.

My EdgeRouter-X permits me to create the second subnet. My question is, does the second subnet for the vpn VM require that I install a second physical NIC in my host machine specifically for the vpn? Or can I run two subnets over the same NIC and then use the settings for each guest to specify the subnet it will be connected to?

If this has already been answered, please point me to the post as I may not be using the appropriate search string.

Thanks for any and all help.
Post Reply