2.4. Network settings of VirtualBox

Now, let's take a closer look at the network settings in VirtualBox:

VirtualBox network settings

VirtualBox network settings: the list of options to selelect

We will only consider the settings that will be used in this course.

 

NatNetwork mode

The main feature of this mode is that all virtual machines can interact with each other, and they also have access to the external network, which includes the local network and the internet. However, to use this mode, you need to create a virtual NAT network. This is done easily. In VirtualBox, go to File -> Tools -> Network Manager or simply press Ctrl + H.

Go to the NAT Networks tab and then click on the Create icon:

VirtualBox network settings: creation of Nat network

The network will be added, and after that the IP address range 10.0.2.0/24 and DHCP server will be configured immediately:

VB network settings: Ip address range of created Nat network

After creating the virtual network, you can select the NatNetwork mode and choose the created virtual network as the network to use. 

The operation of this mode looks like this:

Principle of operation of NatNetwork mode in VirtualBox

 

When to use this mode?

You can use this mode in almost all situations, except when you are testing viruses and network worms because they can spread through the network. In such cases, the machine must be completely isolated. By default, devices on the local network cannot connect to virtual machines by themselves because they have IP addresses assigned from different subnets. This situation can be resolved by configuring routing in the local network and port forwarding in VirtualBox. However, this may require some additional configuration, so it's often easier to use the Bridge Adapter mode.

 

Bridged Adapter mode

If you set up a Bridged adapter, your virtual machine becomes part of your local network. In other words, it will also receive an IP address from your local router and will be accessible to all network elements in your network.

The operation of this mode looks like this:

Principle of operation of Bridge mode in VirtualBox

When to use this mode?

You can also use this mode in almost all cases, except when you are dealing with viruses and trojans. As mentioned earlier, the virtual machine should be completely isolated from the entire network.

The Internal network and Host-only adapter modes, in contrast, are specifically used to isolate virtual machines from external networks.