how to network guests within the same host and between different hosts

This is for discussing general topics about how to use VirtualBox.
Post Reply
markLopez9
Posts: 1
Joined: 7. Sep 2020, 11:14

how to network guests within the same host and between different hosts

Post by markLopez9 »

Hi,

I'm trying to build a virtual environment where I can test some networking stuff. I'm looking for guidance on how to configure the network setting of my guests so they can talk to each other within the same host and (if possible) with another guest in a different host. I hope the following details will paint a better picture.
INSTALLATION:
Host A
[*]guest 1 runs Fedora (endpoint guest)
[*]guest 2 runs OpenWrt (router guest)
[*]guest 3 runs OPNsense (firewall guest)
Host B
[*]guest 4 runs Ubuntu (endpoint guest)
SETUP 1
[*]guest 1 and guest 2 forms their own subnet
[*]guest 2 provides the IP address for guest 1 via DHCP
SETUP 2
[*]guest 3 and guest 4 forms their own subnet
[*]guest 3 acts as a network firewall and DHCP/DNS server for guest 4

So setup 1 can run simultaneously on one host because OpenWrt doesn't require a lot of memory, but I really have to run the other endpoint guest on a separate host for setup 2 because availability issues on total memory. I've tried the various configuration specified in the manual, i.e. internal networking or bridged, but none of them are producing the setup I'm looking for. Can anyone help, please?
scottgus1
Site Moderator
Posts: 20945
Joined: 30. Dec 2009, 20:14
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows, Linux

Re: how to network guests within the same host and between different hosts

Post by scottgus1 »

Take a look at Virtualbox Networks: In Pictures, see what Virtualbox can do.
BillG
Volunteer
Posts: 5105
Joined: 19. Sep 2009, 04:44
Primary OS: MS Windows 10
VBox Version: PUEL
Guest OSses: Windows 10,7 and earlier
Location: Sydney, Australia

Re: how to network guests within the same host and between different hosts

Post by BillG »

That can be done, but you will need to have a clear idea of how you would do it with physical machines before you try to emulate it in a virtual setup. When thinking about your network diagram, ignore the host machines. Regard them as "black boxes" which power your vms. Do not include them in your network diagram - they are not part of the scheme you are trying to emulate.

Networks which contain only virtual machines can be set up as internal (ie virtual) networks, and you can configure these vms just as you would configure physical machines connected to the same switch. You can route between internal networks (on the same host) using a vm as a router. Virtual machines which need to connect to the physical network, such as the public side of your Internet router, will need to be bridged to a physical NIC in a host PC. Traffic between virtual networks on different hosts will also need to be routed via the physical network if you want them to communicate.
Bill
Post Reply