3.3.b Configure NAT and PAT

ENCOR 350-401 v1.2 · 3.0 Infrastructure

ENCOR revisits NAT with more options: static NAT and static port forwarding, dynamic NAT with pools, PAT on an interface or a pool, NAT with route maps, and the verification and troubleshooting around them.

What you must know

The variants

interface GigabitEthernet0/0
 ip nat outside
interface GigabitEthernet0/1
 ip nat inside
!
! static NAT and a port forward
ip nat inside source static 10.1.1.10 203.0.113.10
ip nat inside source static tcp 10.1.1.20 443 203.0.113.2 8443 extendable
!
! PAT for everyone else on the outside interface
ip access-list standard INSIDE
 permit 10.1.0.0 0.0.255.255
ip nat inside source list INSIDE interface GigabitEthernet0/0 overload

Connections to port 8443 on the router's address reach the web server (1), while the LAN shares the same address with PAT (2). extendable lets the same inside address appear in more than one static entry.

Order of operations and route maps

Inside to outside, IOS routes first, then translates; outside to inside it translates first, then routes. That is why an outside ACL must match the global address, and an inside ACL the local one. With two ISPs, ip nat inside source route-map ISP-A interface Gi0/0 overload and a second line for ISP B let each exit use its own address: the route map matches on the outgoing interface (match interface).

Commands

show ip nat translations [verbose]Every translation with timers.
show ip nat statisticsHits, misses, pools and interfaces.
clear ip nat translation *Removes dynamic entries.
ip nat translation timeout 3600Changes the idle timeout of dynamic entries.

Exam traps

Check yourself

Write a port forward from 203.0.113.2:2222 to 10.1.1.30:22.
ip nat inside source static tcp 10.1.1.30 22 203.0.113.2 2222 extendable.
Inbound from the internet, which happens first: routing or NAT?
NAT (outside to inside translates first).
How do you PAT out of two ISPs with each ISP's address?
Two ip nat inside source route-map … interface … overload lines, each route map matching its outgoing interface.

Labs

Try it live: NAT and PAT: static NAT, port forwarding and address pools

More topics in 3.0 Infrastructure