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
- Configure static NAT, static PAT (port forwarding), dynamic NAT and PAT.
- Mark inside and outside interfaces and explain the order of operations (routing versus translation).
- Use route maps to translate differently per outside interface.
- Verify and clear translations, and adjust timeouts.
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 overloadConnections 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 statistics | Hits, misses, pools and interfaces. |
clear ip nat translation * | Removes dynamic entries. |
ip nat translation timeout 3600 | Changes the idle timeout of dynamic entries. |
Exam traps
- Inside to outside: route then translate. Outside to inside: translate then route.
- A static port forward needs the protocol and both ports.
- Dynamic entries stay until they time out; clear them after a change.
- Route maps let PAT pick the address of whichever ISP the packet leaves through.
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 … overloadlines, 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
- 3.1.a Troubleshoot 802.1Q trunks, whether configured statically or negotiated
- 3.1.b Troubleshoot static and dynamic EtherChannels
- 3.1.c Configure and verify RSTP and MST, plus protections such as root guard and BPDU guard
- 3.2.a Compare EIGRP and OSPF: algorithm, load balancing, path selection, metrics, areas
- 3.2.b Configure simple OSPFv2/v3: multiple areas, summarization, filtering, network types, passive interfaces
- 3.2.c Configure and verify eBGP between directly connected neighbors
- 3.2.d Describe policy-based routing
- 3.3.d Describe multicast: RPF check, PIM-SM, IGMPv2/v3, SSM, bidir, MSDP