NAT Bridge vs Host-Only Network: Key Differences
In this article
NAT (Network Address Translation) and host-only are two virtual machine (VM) network modes that control how a guest OS connects to the outside world. The core difference: NAT gives the VM internet access through your host machine's IP address, while host-only creates a private network that only the host and the VM can see, with no internet connectivity. This article explains exactly how each mode works, when to choose one over the other, and how to troubleshoot common issues.
Background: Why Virtual Network Modes Exist
When you install a hypervisor (like VirtualBox, VMware, or Hyper-V), it creates virtual network adapters that behave like physical Ethernet cards. Each mode—NAT, bridged, host-only, and internal—determines how those virtual adapters route traffic. The mode you pick affects whether the VM can reach the internet, whether other machines on your physical LAN can see the VM, and whether the VM can see the host.
The three most common modes are:
- NAT: The VM shares the host's IP address; outbound traffic goes through the host, but inbound connections from other machines are blocked (unless you set up port forwarding).
- Bridged: The VM gets its own IP on the same network as the host, appearing as a separate device on your LAN.
- Host-only: The VM is on an isolated private network with the host; no internet, no LAN access.
Understanding these differences helps you avoid security risks and connectivity headaches when setting up test environments, servers, or development sandboxes.
How NAT Mode Works
In NAT mode, the hypervisor creates a virtual network that includes the VM and a virtual router (the host). The host acts as a gateway, translating the VM's private IP address (e.g., 10.0.2.15 in VirtualBox) to the host's own IP when sending traffic out. The VM can initiate connections to the internet—browsing, downloading, SSH to external servers—but incoming connections from the internet or your LAN cannot reach the VM directly.
Key characteristics:
- VM gets a private IP (usually 10.0.2.x or 192.168.56.x depending on hypervisor).
- Internet works out of the box; no manual IP configuration.
- The host's firewall protects the VM from unsolicited inbound traffic.
- To allow inbound access (e.g., to run a web server), you must configure port forwarding on the host.
NAT is the default in most hypervisors because it's the safest and simplest way to give a VM internet access without exposing it to the network.
How Host-Only Mode Works
Host-only mode creates a virtual Ethernet network that is completely isolated from the host's physical network. Both the host and the VM are attached to this virtual switch, and they can communicate with each other using private IPs (e.g., 192.168.56.1 on the host, 192.168.56.101 on the VM). However, there is no default gateway to the internet—the VM cannot reach the outside world unless you add a second network adapter (e.g., NAT) or configure IP forwarding on the host.
Typical uses:
- Testing client-server applications where the host needs to access the VM's services (e.g., a database or web server) but the VM should not access the internet.
- Creating isolated lab environments for security testing or malware analysis.
- Setting up a private network between multiple VMs (they can all be on the same host-only network).
Host-only is not the same as "internal" mode; internal mode removes the host from the network entirely, so VMs can talk to each other but not to the host.
Bridged Mode: The Third Option
Bridged mode is often mentioned alongside NAT and host-only, so it's worth clarifying. In bridged mode, the hypervisor connects the VM's virtual adapter directly to the host's physical network adapter. The VM receives an IP address from your router (e.g., 192.168.1.50), just like any other device on your LAN. It can access the internet, and other machines on the LAN can reach the VM directly.
When to use bridged:
- You want the VM to appear as a separate device on your network (e.g., for a game server or a network-attached service).
- You need the VM to be accessible from other computers without port forwarding.
- You're testing network services that rely on broadcast or multicast.
Bridged is less secure than NAT because the VM is exposed to the LAN, and it can cause IP conflicts if your router assigns the same IP to another device.
How to Choose: NAT vs Host-Only vs Bridged
The right mode depends on what you're trying to accomplish. Here's a practical decision guide:
- Need internet but don't want inbound access? → Use NAT.
- Need the VM to be reachable from your LAN? → Use bridged.
- Need to isolate the VM from the internet but still talk to it from the host? → Use host-only.
- Need multiple VMs to talk to each other but not to the host? → Use internal mode (if available).
- Want both internet and host-only access? → Add two network adapters: one NAT, one host-only.
For most desktop users running a VM for testing or development, NAT is the best default. If you're running a web server that you want to access from your phone on the same Wi-Fi, bridged is the way to go. Host-only is ideal for secure, offline experiments.
Common Problems and Troubleshooting
Even with the right mode, you may hit issues. Here are frequent problems and fixes:
- No internet in NAT mode: Check that the host has internet, then verify the VM's DHCP client is enabled. Restart the network service in the guest (e.g.,
sudo systemctl restart networkon Linux) or reboot the VM. - Can't ping the host from a host-only VM: In VirtualBox, the host-only adapter must have an IP set (e.g., 192.168.56.1). On Windows, you may need to enable the virtual adapter in Network Connections.
- IP conflict in bridged mode: Set a static IP on the VM that is outside your router's DHCP range, or use DHCP but reserve the IP in your router.
- Port forwarding not working: In VirtualBox, go to Settings → Network → Advanced → Port Forwarding. Make sure the host IP is 127.0.0.1 (or blank) and the guest IP is correct. Also, ensure the guest firewall allows the traffic.
- Host-only network disappears after reboot: In VirtualBox, go to File → Host Network Manager and ensure the adapter is enabled and persistent.
Security and Performance Considerations
Security-wise, NAT is the safest because the VM is hidden behind the host's firewall. Bridged mode exposes the VM to the LAN, so it should only be used with a proper guest firewall. Host-only is safe from the internet but still allows the host to access the VM, which can be a risk if the host is compromised.
Performance-wise, NAT and host-only add a small layer of translation, but the impact is negligible for most tasks. Bridged mode can be slightly faster for high-throughput networking because it avoids NAT translation, but the difference is rarely noticeable outside of heavy file transfers.
Frequently Asked Questions
Can I use both NAT and host-only at the same time?
Yes. Most hypervisors allow multiple network adapters per VM. For example, you could set adapter 1 to NAT for internet access and adapter 2 to host-only for private communication with the host. This is a common setup for development VMs that need to fetch packages from the internet but also be accessed via SSH from the host.
Why can't I ping the VM from another computer on my LAN when using NAT?
Because NAT hides the VM behind the host's IP. The VM's private IP (like 10.0.2.15) is not routable from your LAN. To make the VM reachable, you need to either use bridged mode or set up port forwarding on the host.
Does host-only mode provide internet if I configure a proxy?
No. Host-only mode has no gateway to the internet by design. Even with a proxy on the host, the VM cannot reach the host's physical network unless you add a second adapter or enable IP forwarding on the host (which is complex and not recommended for beginners).
Is NAT mode slower than bridged mode?
In theory, NAT adds a small overhead because every packet is translated. In practice, the difference is negligible for most applications. If you're doing heavy network throughput (like a file server), bridged might be slightly faster, but you're more likely to notice the difference in latency than in speed.
What is the default IP range for NAT and host-only in VirtualBox?
In VirtualBox, NAT typically uses 10.0.2.0/24 (the VM gets 10.0.2.15, the gateway is 10.0.2.2). Host-only networks default to 192.168.56.0/24 (the host adapter is 192.168.56.1). These can be changed in the VirtualBox network settings.
Can a host-only VM access the internet if I enable IP forwarding?
Technically yes, but it requires configuring the host as a router (enabling IP forwarding and setting up NAT rules on the host). This is advanced and not a standard feature of host-only mode. For most users, adding a second NAT adapter is simpler and more reliable.