Types of Networks in VirtualBox

Dan Covic
4 min readFeb 15, 2024

--

Prioritize security (and secure systems) before anything else!

Welcome on board, fellas.

I assume you have already set up your own Hacking Lab — a Kali Linux VM and some other (most probably vulnerable) VMs — in your VirtualBox.

So, now you want to get your hands dirty…

Please, stop!

Let’s first explore the different networking types in VirtualBox before jumping into the cool stuff. This will help us better understand how we can protect our hacking environment from the outside world!

We have to realize that if we don’t understand what the different network types are, we can then easily fuck it up and expose our vulnerable machines on the Internet.

Let’s avoid this.

Network Types

If you open a VM in VirtualBox and navigate to the Network Settings, in the Attached to select box, you can see the various types of network settings available:

So, what are these network types? What’s the difference between them?

Let’s explore the most important ones.

Network Address Translation (NAT)

  • NAT is the simplest way of accessing an external network from a VM.
  • Usually, it does not require any configuration on the host network and guest system. For this reason, it is the default networking mode in Oracle VM VirtualBox.
  • A VM with NAT enabled acts much like a real computer that connects to the Internet through a router.
  • The router, in this case, is the Oracle VM VirtualBox networking engine, which maps traffic from and to the virtual machine transparently.
NAT

The most important thing to remember about this type of network is that each VM has its isolated network. In other words, the different VMs hosted on VirtualBox do not know of each other’s existence. They cannot communicate with one another. However, each VM can use the NAT engine to connect to the internet using the physical machine hardware. Last but not least, every machine will be assigned an IP address by the DHCP server.

NAT Network

This network setting enables VMs to form a virtual network. The VMs can use a switch to connect to the physical machine and through the physical machine the VMs can connect to the internet. So, in this type of network, all the machines are connected. They can send files to each other via FTP, establish connections, etc.

NAT Network

As mentioned above, this is also called a Virtual Network. Just as with NAT, every machine will be assigned an IP address by the DHCP server. Last but not least, all the instances can connect to the internet independently.

Check this article if you are interested in setting up a Host-Only Network.

WARNING: THE (VULNERABLE) VMs IN THIS TYPE OF NETWORK ARE EXPOSED TO THE INTERNET!!!

Host-Only Adapter/Network

  • When you connect VMs on a host-only network, the VMs will not be able to access the internet. So, they are not exposed to the outside world. The VMs are only connected to the host adapter (switch). However, each machine can communicate with each other.
  • Host-only networking provides a network connection between the VM and the host computer, using a virtual Ethernet adapter that is visible to the host OS.
Host-only adapter
  • This approach can be useful if you need to set up an isolated virtual network.
  • Check this article if you are interested in setting up a Host-Only Network.

BEST PRACTICE: THE (VULNERABLE) VMs IN THIS TYPE OF NETWORK ARE ISOLATED AND NOT EXPOSED TO THE INTERNET!!!

Internal Network

In this article, you can find more info and the necessary steps on how to build an internal network.

BEST PRACTICE: THE (VULNERABLE) VMs IN THIS TYPE OF NETWORK ARE ISOLATED AND NOT EXPOSED TO THE INTERNET!!!

In other words, this approach can be useful if you need to set up an isolated virtual network (just like the host-only adapter).

The main difference between the Host-only Adapter/Network and the Internal Network is that the former has already a DHCP server built-in whereas in the latter you have to install the DHCP server manually.

That’s a wrap!

--

--