
$ VBoxManage natnetwork add -netname NATNetwork101 -network "192.168.10.0/24" -enable Open a command prompt ( cmd or terminal if you are on Linux/Mac) # Check existing NAT Networks Create a NAT Network using VBoxManageutility In below example, we have added a Port Forwarding rule so that the VM IP 192.168.10.5:22 can be accessed via localhost:1022. You can also add Port Forwarding for accessing VM (over ssh or http kind of protocols). Open VirtualBox Preferences ( File -> Preferences) and go to Network Tab. Create a NAT Network using VirtualBox GUI Also these VM’s was talk to outside world (Virtual host, local network and internet) How to Create a NAT Network Image Courtesy: You can create NAT Network from the VirtualBox GUI or by using VBoxManageutility.

All the VM’s connected to the NAT Network can talk each other as in the same network. This is not really needed if you can configure and use a NAT Network. Image Courtesy: So I found people create internal network interface for the VM’s and assign a different IP address to talk each other.

But the with NAT interface will not be able to talk to another VM with NAT interface and not suitable for your case. Eg: I want to do Penetration Testing on some VM’s and I do not want to interrupt other network on host or in the environment.īy default the VirtualBox will create a network interface for VM with NAT mode by which you can access the outside world (including internet) from the VM. But you do not want other machines in the VirtualBox or Virtual Host (your laptop or workstation) or other devices in the network to talk to these VM. Here is the scenario: You are doing some labs with multiple Virtual Machines and you need those VM’s to talk each other.

Scenario : Create VM’s in Isolated Network There is no harm on that but you can achieve the same result using NAT Network in VirtualBox. Recently I noticed that, some of the engineers are creating labs in VirtualBox but they are adding more and more interface for multiple type of connections.

When we talk about local development or PoC (Proof of Concept) environments, VirtualBox is my first choice as it gives me the choice of multiple options in terms of networking and other features. Photo by Brett Sayles from Pexels Introduction
