Concepts / Address translation

Address translation

Static NAT, dynamic NAT and PAT

Also called static NAT, dynamic NAT, NAT pool, PAT, overload, port address translation, inside local, inside global, outside local, outside global, ip nat inside source

One address for one device (static), addresses from a pool as devices go out (dynamic), or one address shared by port (PAT).

Cisco names a translated conversation's four addresses from the router's side: inside local (the inside device's own address), inside global (what the outside sees for it), outside global (the outside device's real address) and outside local (how the inside sees it; the same unless destinations are rewritten too). Static NAT maps one inside local to one inside global for good, both ways, so the outside can start a connection: the way to publish a server. Dynamic NAT hands out inside globals from a pool as inside devices connect, one each on IOS, and refuses a device when the pool runs out. PAT (IOS overload) shares one address, telling conversations apart by source port: what nearly every home and office router does. The inside globals must be addresses the outside routes to the router. On Linux: SNAT (and DNAT for static's inbound half) or MASQUERADE in iptables' nat table, with the translations in conntrack -L.

See it on real machines

Learn it on real machines.

Every lab is a small network of real Linux machines in your browser. Start with a free account: Google or email, no card.

Open this lab