How to Create and Configure NAT or Host-Only Networks in VirtualBox

If you want to know how you can configure your host-only or NAT networks in VirtualBox, then stay and read this article that is for you. We are going to tell you about at least 3 networks and how to configure them or how to configure and connect virtual machines via Wifi or external network in VirtualBox

How to configure the bridge adapter and internal network?

Speaking about the Bridge Adapter, it is a connection to the physical network interface or virtual card . These are created with other viewers such as VMWare and configuring it is quite simple from the graphical environment.

You will only have to define the network card or install a wireless network card in a PC in case your desktop PC does not have one. From the commands you will be able to know the bridge adapters that in this case you can use as commands:

  • VBoxManage list bridgedifs // This will be the list of available bridging networks

It is important that you keep in mind that if the network interface to which you are connected is disconnected due to lack of cable or Wi-Fi, then you will not have any communication. Therefore, if you have several computers connected to the adapter, just by disconnecting the Wi-Fi or cable, everything will be cut off.

How to configure the internal network?

This is the second network that we will talk about today. It is a network that is used often and at the same time it is very easy to configure. This internal network or R_Int1 only allows you to see virtual machines that connect to it since you will have the opportunity to have several internal networks separated from each other .

Setting up this network is just as easy as the previous one, so you must choose the internal network you want or if you wish, write the name of a new one. You must type the following command so that you can see the internal networks that you have configured:

  • VBoxManage list intnets // You will be able to see the internal networks that are available

As this class of networks does not have DHCP, the configuration that you are going to do will have to be done manually or place one of them to act as DHCP. It is as if you define a cable to which you will be putting computers.

This type of network is used when you want the machines to be isolated, for example to protect your system from any virus that could infect it.

How to configure the NAT network?

This type of network will allow you to connect to the Internet just like NAT, but this time not only to a computer, but it will allow you to connect several machines on the same network.

It is as it were if you put together an internal network together with access to the internet. In this case it will be the R_ExtLAB network and like the rest, the next field is the one that will define the network, only this time you will have to define it first.

This type of configuration can be done graphically using VirtualBox or manually, but in case you do not have it on your PC you can download Virtualbox for free for Windows, however, first of all it is important that you take into account certain things that you we will show below.

As the first point to take into account you should look at the Limitations of the ICMP protocol if in your case the ping works correctly but a tracer remains in your virtual router without being able to know the next jumps.

But it is not the only thing, you must bear in mind that the reception of UDP broadcasts is not to be trusted. That only TCP and UDP protocols are supported, and that you will have problems for forwarding ports less than 1024 except for those you run in Root. In order to overcome these problems you can use a bridge network.

It is time to see what are the commands that you can use so that you can configure the NAT networks. The first thing you should do is type the command that will allow you to see the NAT networks that are configured.

  • vboxmanage list natnets // This command will show you the configured NAT networks

In addition, changing these settings will not only be possible from the graphical interface, but you can also do it from the command line:

  • VBoxManage natnetwork stop | start –netname <our network> // enable and disable the network
  • VBoxManage natnetwork modify –netname <our network> –dhcp on | off // turn DHCP on or off
  • VBoxManage natnetwork add –netname <The network> –network «<Network definition>» –enable –dhcp on // Create it
  • VBoxManage natnetwork remove –netname <The Network> // Remove it

 

Leave a Comment