VirtualBox is a type 2 hypervisor widely used by users who are dedicated to any area of computing, since, as a good hypervisor, allows the implementation of virtual machines and better use of hardware resources, but often users do not know how to configure the types of networks in VirtualBox, This causes that, even if they make correct implementations of their virtual machines, these cannot communicate with each other, causing that, for example, if they want to create a machine that serves as a pentesting test platform, it cannot communicate with a BlackBuntu to start practising.
That is why we are going to discuss the types of networks available in VirtualBox and in which contexts to use one or the other.
Types of networks in VirtualBox
Well, VirtualBox currently has seven types of network adapter configurations available, these are.
- Bridged adapter.
- Internal Network.
- Host-Only Adapter.
- NAT Network.
- Generic Controller.
- Not connected.
To better understand each one (which is the aim of this article) we are going to make a definition and a practical example of use where they could be useful.
What is NAT
NAT stands for Network Address Translation and, in this type 2 hypervisor, it is the type of network that will allow the virtual machine to maintain an internet connection, but it will not be able to see other machines in the virtual network, i.e., if you have 3 virtual machines and all 3 have their adapters configured as NAT, all of them will be able to access the internet (if you have a connection on the host machine) but they will not be able to see each other as a “local” connection in the virtual network.
In addition, the IP address assigned to the machine is that of a VirtualBox virtual network, usually in the reserved range 10.0.0.0.0, since, in this network topology, the router is your host machine, which acts as a virtual router.
What is Bridge Adapter
This adapter allows the virtual machine to have an internet connection (even if your host machine has one) and, in addition, allows the IP address assigned not to be that of a virtual network, but one within the range of your own local network, which allows the virtual machine to communicate with the devices on your network, so if you have a printer on your local network, with a virtual machine with a bridge adapter, you could communicate with the printer and send photos of the SIUUU Bug to print.
Also, you can select the physical device connected to your host machine that you want the virtual machine to use, as it will not use a virtual one in this case.
What is Internal Networking
This adapter is the opposite of NAT, since the machines that have it configured as a connection type and, in addition, are within the same internal network created, can communicate with each other, as is done in, for example, a LAN, only in this case, a priori, the machines will not have access to the internet. This adapter is often quite useful when you want to test locally and, logically, do not need internet resources to function.
What is Only-Host Adapter
In this connection mode, the virtual machine can only have visibility with the host machine, also (and it is important to clarify this) if you have internet connection in the host machine, the virtual machine will also have it, it is really a connection mode that is hardly used.
What is Nat Network
The NAT Network is let’s say a NAT on steroids, since, the operation is similar, it allows connection to Internet using the host machine as a virtual router and creates a virtual network, with the difference that, here all the machines that are configured in NAT Network and, obviously, are in the same network, will be able to have both access to Internet and communicate between them, this is the mode that you will probably use the most.
What is Generic Controller
This connection is basically telling VirtualBox “Hey handsome, do not configure any type of adapter that I install one when I start the virtual machine”, because you are not disabling the adapter, but you are not indicating a specific configuration, likewise, this type of connection is usually used in very specific cases.
What is Not connected
Finally there is the connection in Not connected, this basically means that through various cognitive processes where they saw several subconscious beliefs involved, the individual (that is you) decided to send a signal to VirtualBox that the network adapter (the virtual network card) is connected to the virtual motherboard, BUT, it does not have any connection on it, so the machine is incommunicado.
Keep in mind that, if you are going to create labs to practice pentesting or practice with several machines, you will most likely use a lot of NAT network connection type, if you only work with one machine at a time, you will almost certainly use NAT and if you don’t use VirtualBox, I don’t know what you are doing reading this but thanks for your time.