Differences

Compared

NAT vs PAT

NAT rewrites addresses as packets pass a router. Static NAT maps one inside address to one outside address for good. Dynamic NAT lends outside addresses from a pool. PAT shares one outside address among many devices and tells their conversations apart by port: what nearly every home and office router does.

Side by side

Static NATDynamic NATPAT
Maps One inside address to one outside address, fixedInside addresses to addresses from a pool, as devices connectMany inside addresses to one outside address
Tells conversations apart by AddressAddressSource port
Outside addresses needed One for each deviceOne for each device talking at the same timeOne
The outside can start a connection Yes: the way to publish a serverNo fixed mapping to aim atNo, unless a port forward says where it goes
Runs out when Never: the mapping is fixedThe pool is empty: the next device is refusedThe ports of the one address are used up
On Linux (iptables, nat table) SNAT, with DNAT for the inbound halfSNAT to a range of addressesMASQUERADE, or SNAT to one address
Also called One-to-one NATPool NATNAT overload, NAPT, masquerading

Each one explained

NAT
A router rewriting addresses as packets pass, usually to hide many private devices behind one address.
Static NAT, dynamic NAT and PAT
One address for one device (static), addresses from a pool as devices go out (dynamic), or one address shared by port (PAT).
Port forward
One port on the router's public address passed to one device and port inside.
Private addresses
Address ranges any organisation may use inside, never routed on the internet: 10/8, 172.16/12, 192.168/16.

See the difference on real machines

Each lab is a small network of real Linux machines in your browser.

Open NAT explained: static, dynamic and PAT on one router

When it breaks

Sources

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Sign in with Google or email to start.

Start this lab