Internet access on client with DHCP running on internal network

Discussions related to using VirtualBox on Windows hosts.
Post Reply
romavyn
Posts: 2
Joined: 29. Oct 2020, 12:03

Internet access on client with DHCP running on internal network

Post by romavyn »

Hi,
I'm trying to create a VLAN network like this:

DHCP ---------- CLIENT1
\ |
\---------CLIENT2

So I've added 2 adapters for each machine with Adapter1 set to Bridged Adapter and Adapter2 = Internal Network.
DHCP server is working fine, giving the IP addresses for the clients, and clients got access to the internet.
But the machine with DHCP cannot access the internet.

Used enp0s8 as interface for DHCP, and i'm not sure if i have to do anything with enp0s3.
interfaces.JPG
interfaces.JPG (47.7 KiB) Viewed 985 times
ifconfig.JPG
ifconfig.JPG (105.65 KiB) Viewed 985 times
ping.JPG
ping.JPG (66.54 KiB) Viewed 985 times
Do you have ideas how to fix it?

Regards,
Roman
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows, Linux

Re: Internet access on client with DHCP running on internal network

Post by scottgus1 »

Please right-click each guest in the main Virtualbox window's guest list, choose "Show in Explorer/Finder/File Manager". In the window that opens, zip the guest's .vbox file, and post the zip file, using the forum's Upload Attachment tab. Please label which one is which.
romavyn
Posts: 2
Joined: 29. Oct 2020, 12:03

Re: Internet access on client with DHCP running on internal network

Post by romavyn »

Hi,
Only .vbox files?
DHCP-server.zip
DHCP server
(1.38 KiB) Downloaded 3 times
O-RU.zip
client1
(1.69 KiB) Downloaded 2 times
Controller.zip
client2
(1.72 KiB) Downloaded 2 times
BillG
Volunteer
Posts: 5106
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: VirtualBox+Oracle ExtPack
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: Internet access on client with DHCP running on internal network

Post by BillG »

DHCP might be working, but how is the internal network supposed to see the Internet? You are using private IP subnets. They need a NAT router somewhere to access the Internet.

The best idea is to give the guests just one NIC and run one vm as a router between the private LAN and the Internet via your physical LAN router. The router vm has one NIC in the internal network and one bridged to your physical LAN. The internal NIC is the gateway for your internal (virtual) LAN and the external NIC is set to bridged.

Internet
|
physical NAT router -> physical LAN (including host PC)
|
192.168.1.x (set to bridged - network config from physical NAT router)
virtual router
192.168.2.254 gateway blank
|
vms 192.168.2.x dg 192.168.2.254 (network config from local DHCP)

You don't even need DHCP on the internal network if you run the virtual router as a NAT router. You just need to set its private NIC manually to be the default gateway for the LAN, then set up the virtual router as a NAT router and it will do the DHCP for you.

There are plenty of router appliances you can use - pfSense works well with VirtualBox.
Bill
Post Reply