VIRTUALBOX
Build an advanced networking test lab
Stuart Burns brings us up to date on his networking insights and covers expanding the networked virtual lab beyond the single host.
OUR EXPERT
Stuart Burns is a systems administrator who specialises in virtualisation at scale, public cloud and virtual disaster recovery. When not doing that he can be found dabbling in Linux.
Previously we’ve looked at networking basics to help build a virtual test lab using VirtualBox. In the last article (LXF280) we cover some of the more advanced features and networking in general, some outside of VirtualBox. One example is wired networking and segmentation beyond VirtualBox, but within a home lab. Home labs tend to sprawl well beyond one single box due to resource constraints (a 64GB laptop is not cheap!)
As it’s been a little while it’ll be best to recap a little, it’s important to understand the types of networking available in VirtualBox and how they can be used in home labs. So far we’ve only used two types of networking that VirtualBox provides:
Bridged (connected to local network as though it’s any other computer on the local network). It has the same communication capabilities as other resources on the local network. It’ll function as any other network device on it, including DHCP and such-like.
Internal, as the name suggests, is essentially a standalone isolated network, hence we had to use a router to enable that internal network to communicate with other networks. In our previous article we covered how to use pfSense as a router, with one foot in the local network (Bridged) and one in the isolated LAN, configuring all the traffic to be allowed through, with an appropriate route specified (a recap on routes can be found further in the article).
NAT (Network Address Translation) essentially creates an isolated network, but one that can forward traffic to the outside world (so, for example, it can see and utilise an internet connection if there’s one on the real network, but is effectively an isolated network.) It’s also the default network type selection within VirtualBox. NAT comes with benefits and drawbacks...
Using a jump box to grant access to NAT network from local network, making access and management that little bit easier.
When using NAT only the local desktop that’s running VirtualBox knows about the VirtualBox servers it’s hosting. That can be a drawback, inasmuch as there’s no default connectivity to the network that the rest of the infrastructure sits on.
NAT is also the default network setting out of the box when a virtual machine is created. The VirtualBox host performs the NAT functionality. As part of the VirtualBox functionality it also provides DHCP IP address allocation for the NAT network. It can be manually configured if desired, or there’s a real reason to do it. Think of NAT as an isolated network that can reach the internet. It’s up to the reader to decide which is more appropriate.