Network Address Translation (NAT) is the simplest way of accessing an external network from a virtual machine.
Usually, it does not require any configuration on the host network and guest system. For this reason, it is the
default networking mode in
A virtual machine with NAT enabled acts much like a real computer that connects to the Internet through a router.
The router, in this case, is the
The disadvantage of NAT mode is that, much like a private network behind a router, the virtual machine is
invisible and unreachable from the outside internet. You cannot run a server this way unless you set up port
forwarding. See
The network frames sent out by the guest operating system are received by
Even though the NAT engine separates the VM from the host, the VM has access to the host's loopback interface and the network services running on it. The host's loopback interface is accessible as IP address 10.0.2.2. This access to the host's loopback interface can be extremely useful in some cases, for example when running a web application under development in the VM and the database server on the loopback interface on the host.
The virtual machine receives its network address and configuration on the private network from a DHCP server
integrated into