Pcornel
Browse topics
Options
Recent
Favorites
Virtualization · Technical reference

NAT (Network Address Translation)

Direct answer

NAT in virtual networking lets VMs on a private network share the host's or a virtual router's IP address to reach other networks, and can publish a VM service through port forwarding. It is the default network mode in many desktop hypervisors and libvirt.

When to use this

Use it when a VM is behind a hypervisor/virtual-router NAT network or when connectivity depends on translation rather than direct bridged/routed addressing.

First 30 seconds

1. NAT hides VMs behind the host IP.

2. Good for labs; inbound needs port forwards.

3. libvirt default network: 192.168.122.0/24.

4. Check forwarding and masquerade rules.

5. Not for production servers.

Operational verification

VM → NAT network → masquerade → host uplink

Evidence · next step

Test representative inbound/outbound rules and state expiry/failover if relevant.

Continue only after interpreting the current observation.
Context & applicabilityCommon mistakes · platform/version boundaries
Common mistakes
Common traps

It does not show all rules, ports, remote services or long-lived state behavior.

Next check: Test representative inbound/outbound rules and state expiry/failover if relevant.

Platform / version applicability
virtualization-network
applies
Structured applicability is explicit Topic metadata; it does not infer compatibility beyond the stored rows.
At a glance

Operational reference

Fast context before you go deeper.

Platformvirtualization-network
Scope / prerequisiteUse it when a VM is behind a hypervisor/virtual-router NAT network or when connectivity depends on translation rather t…
What next?3 suggested next steps
Evidence1
On this pageJump to a specific section
Operational workflow

Verification & Troubleshooting

Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.

1 steps Observe → verify → isolate → change minimally → repeat the original test.
ObservedRecord what the original test actually shows

Capture the concrete output, symptom, packet, log or counter before changing anything.

Step 1 Verification path Verify boundary

guest packet → virtual L2/L3 path → NAT match/translation → external route → remote service → return packet → reverse translation → guest

Evidence references

Evidence · 1 on this Topic

Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.

observation · 1
Key points
  • NAT is stateful translation, not a substitute for valid routing and return-path reachability.
  • A translation entry proves matching traffic reached the NAT function, not that the remote endpoint responded.
  • Inbound publishing/port forwarding requires a separate destination translation and policy path.
  • NAT can mask overlapping/private addresses but adds another troubleshooting boundary.
Key checks
  • virsh net-dumpxml default — libvirt NAT network
  • iptables -t nat -L -n -v — NAT rules
  • Get-NetNat — Windows NAT (Hyper-V internal)
ReferenceImportant terms & boundaries3 sections · depth on demand

What this shows and what it does not

A translation entry shows the flow matched and state was created, but it does not show external routing, remote application response or reverse delivery to the guest.

NAT setups

PlatformHow
libvirtDefault network virbr0 NAT (virsh net-list)
Hyper-VInternal switch + New-NetNat -InternalIPInterfaceAddressPrefix 192.168.100.0/24
ProxmoxMasquerade rule on a bridge (post-up iptables -t nat -A POSTROUTING …)
VMware WorkstationVMnet8

In depth

NAT networks let VMs reach outside networks through the host's address without their own routable IPs — default on desktop hypervisors and libvirt (default network on virbr0, 192.168.122.0/24 with dnsmasq).

virsh net-list --all; virsh net-dumpxml default
iptables -t nat -L -n -v | grep 192.168.122
# Hyper-V
New-VMSwitch -Name NATSwitch -SwitchType Internal
New-NetIPAddress -IPAddress 192.168.50.1 -PrefixLength 24 -InterfaceAlias 'vEthernet (NATSwitch)'
New-NetNat -Name LabNAT -InternalIPInterfaceAddressPrefix 192.168.50.0/24

Inbound access needs port forwards; NAT is fine for labs, rarely for servers.

Source basisSource attribution states what this section is based on; it is not independent proof that the current environment matches it.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Technical verification history

Verification history & basis

When and against what this Topic was checked. Later text edits do not count as a new check.

2026-09-14 · vendor docvirtualization-network current

Authoritative/upstream documentation reviewed for bounded claims in Virtual Networking → NAT. Documentation verification only; this is not observed lab or production Evidence.

Basis: https://libvirt.org/formatnetwork.html · confidence 94%
Terminology layer

Terms & aliases

Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.

Aliases that resolve here
virtual natvm nat networkhypervisor natnat virtual machine
Embedded reference data

Quick lookup tables

Virtual Networking → NAT reference map

Fast virtual-network boundaries for Virtual Networking → NAT.

BoundaryMeaningEvidence limit
Pre-NATGuest identityOriginal flow
TranslationMapped address/portState evidence
Post-NATExternal identityEgress evidence
ReverseReturn translationRequired for session
Confirmation

Confirm action

Continue?