Scaling the Network
with NAT and PAT
Address Space Management
[Link]
ICND1 v1.01-1
Network Address Translation
An IP address is either local or global.
Local IPv4 addresses are seen in the inside network.
Global IPv4 addresses are seen in the outside network.
[Link]
ICND1 v1.01-2
Port Address Translation
[Link]
ICND1 v1.01-3
Translating Inside Source Addresses
[Link]
ICND1 v1.01-4
Configuring and Verifying Static
Translation
RouterX(config)# ip nat inside source static local-ip global-ip
Establishes static translation between an inside local address and an
inside global address
RouterX(config-if)# ip nat inside
Marks the interface as connected to the inside
RouterX(config-if)# ip nat outside
Marks the interface as connected to the outside
RouterX# show ip nat translations
Displays active translations
[Link]
ICND1 v1.01-5
Enabling Static NAT
Address Mapping Example
interface s0
ip address [Link] [Link]
ip nat outside
!
interface e0
ip address [Link] [Link]
RouterX# show ip nat translations
ip nat inside
Pro!Inside global Inside local Outside loc
--- [Link]
[Link]
ip nat inside source
static 10---1 1 2 192---1
[Link]
ICND1 v1.01-6
Configuring and Verifying Dynamic
Translation
RouterX(config)# ip nat pool name start-ip end-ip
{netmask netmask | prefix-length prefix-length}
Defines a pool of global addresses to be allocated as needed
RouterX(config)# access-list access-list-number permit
source [source-wildcard]
Defines a standard IP ACL permitting those inside local addresses
that are to be translated
RouterX(config)# ip nat inside source list
access-list-number pool name
Establishes dynamic source translation, specifying the ACL that was
defined in the previous step
RouterX# show ip nat translations
Displays active translations
[Link]
ICND1 v1.01-7
Dynamic Address Translation Example
RouterX# show ip nat translations
Pro Inside global Inside local Outside loc
--- [Link] [Link]
--[Link]
ICND1 v1.01-8
Overloading an Inside Global Address
[Link]
ICND1 v1.01-9
Configuring Overloading
RouterX(config)# access-list access-list-number permit
source source-wildcard
Defines a standard IP ACL that will permit the inside local addresses
that are to be translated
RouterX(config)# ip nat inside source list
access-list-number interface interface overload
Establishes dynamic source translation, specifying the ACL that was
defined in the previous step
RouterX# show ip nat translations
Displays active translations
[Link]
ICND1 v1.01-10
Overloading an Inside Global Address
Example
hostname RouterX
!
interface Ethernet0
ip address [Link] [Link]
ip nat inside
!
interface Ethernet1
ip address [Link] [Link]
ip nat inside
!
interface Serial0
description To ISP
ip address [Link] [Link]
ip nat outside
!
ip nat inside source list 1 interface Serial0 overload
!
ip route [Link] [Link] Serial0
!
access-list 1 permit [Link] [Link]
access-list 1 permit [Link] [Link]
!
RouterX# show ip nat translations
Pro Inside global
Inside local
Outside local
Outside global
TCP [Link]:1050 [Link]:1050 [Link]:23
[Link]:23
TCP [Link]:1776 [Link]:1776 [Link]:25
[Link]:25
[Link]
ICND1 v1.01-11
Clearing the NAT Translation Table
RouterX# clear ip nat translation *
Clears all dynamic address translation entries
RouterX# clear ip nat translation inside global-ip
local-ip [outside local-ip global-ip]
Clears a simple dynamic translation entry that contains an inside
translation or both an inside and outside translation
RouterX# clear ip nat translation outside
local-ip global-ip
Clears a simple dynamic translation entry that contains an outside
translation
RouterX# clear ip nat translation protocol inside global-ip
global-port local-ip local-port [outside local-ip
local-port global-ip global-port]
Clears an extended dynamic translation entry (PAT entry)
[Link]
ICND1 v1.01-12
Translation Not Occurring:
Translation Not Installed in the Table
Verify that:
There are no inbound ACLs that are denying the packets entry to
the NAT router
The ACL referenced by the NAT command is permitting all
necessary networks
There are enough addresses in the NAT pool
The router interfaces are appropriately defined as NAT inside or
NAT outside
[Link]
ICND1 v1.01-13
Displaying Information with show and
debug Commands
RouterX# debug ip nat
NAT: s=[Link]->[Link],
d=[Link] [6825]
NAT: s=[Link], d=[Link]>[Link] [21852]
NAT:
s=[Link]->[Link],
RouterX#
show ip nat statistics
d=[Link]
Total active [6826]
translations: 1 (1 static, 0 dyn
NAT*:
s=[Link],
Outside
interfaces:
d=[Link]->[Link]
[23311]
Ethernet0, Serial2
NAT*:
s=[Link]->[Link],
Inside
interfaces:
d=[Link] [6827]
[Link]
ICND1 v1.01-14
Translation Occurring: Installed
Translation Entry Not Being Used
Verify:
What the NAT configuration is supposed to accomplish
That the NAT entry exists in the translation table and that it is
accurate
That the translation is actually taking place by monitoring the NAT
process or statistics
That the NAT router has the appropriate route in the routing table
if the packet is going from inside to outside
That all necessary routers have a return route back to the
translated address
[Link]
ICND1 v1.01-15
Sample Problem: Cannot Ping
Remote Host
[Link]
ICND1 v1.01-16
Sample Problem: Cannot Ping
Remote Host (Cont.)
RouterA# show ip nat translations
Pro Inside global Inside local Outside local
-------------
Outside global
There are no translations in the table.
[Link]
ICND1 v1.01-17
Sample Problem: Cannot Ping
Remote Host (Cont.)
RouterA# show ip nat statistics
Total active translations: 0 (0 static, 0 dynamic; 0 extended)
Outside interfaces:
Ethernet0
Inside interfaces:
Serial0
Hits: 0 Misses: 0
The router interfaces are inappropriately defined as NAT inside and NAT outsid
[Link]
ICND1 v1.01-18
Sample Problem: Cannot Ping
Remote Host (Cont.)
RouterA# show access-list
Standard IP access list 20
Pings are still
and there
are still no
translations in
the table.
10failing
permit
[Link],
wildcard
bits
255.25
There is an incorrect wildcard bit mask in the ACL that defines
the addresses to be translated.
[Link]
ICND1 v1.01-19
Sample Problem: Cannot
Ping Remote Host (Cont.)
RouterA# show ip nat translations
Pro Inside global
Inside local
--- [Link]
[Link]
Outside local
Outside global
-----
Translations are now occurring.
Pings are still failing.
[Link]
ICND1 v1.01-20
Sample Problem: Cannot Ping
Remote Host (Cont.)
RouterB# sh ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
Gateway of last resort is not set
[Link]/24 is subnetted, 1 subnets
[Link]/24 is directly connected, Serial0
[Link]/24 is subnetted, 1 subnets
R
[Link]/24 is directly connected, Ethernet0
[Link]/24 is variably subnetted, 3 subnets, 2 masks
R
[Link]/24 [120/1] via [Link], 2d19h, Serial0
Router B has no route to the translated network address of [Link].
[Link]
ICND1 v1.01-21
Sample Problem: Cannot Ping
Remote Host (Cont.)
RouterA# sh ip protocol
Routing Protocol is "rip"
Outgoing update filter list for all interfaces is not set
Incoming update filter list for all interfaces is not set
Sending updates every 30 seconds, next due in 0 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 1, receive any version
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
[Link]
Routing Information Sources:
Gateway
Distance
Last Update
Distance: (default is 120)
Router A is advertising the network that is being translated, [Link],
instead of the network address the router is translating into,[Link].
[Link]
ICND1 v1.01-22
Solution: Corrected Configuration
[Link]
ICND1 v1.01-23
Visual Objective 7-1:
Configuring NAT and PAT
WG
A
B
C
D
E
F
G
H
[Link]
Router s0/0/0
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
10.2.2.
10.3.3.
10.4.4.
10.5.5.
10.6.6.
10.7.7.
10.8.8.
10.9.9.
ICND1 v1.01-24
Summary
There are three types of NAT: static, dynamic, and
overloading (PAT).
Static NAT is one-to-one address mapping. Dynamic NAT
addresses are picked from a pool.
NAT overloading (PAT) allows you to map many inside
addresses to one outside address.
Use the show ip nat translation command to display the
translation table and verify that translation has occurred.
To determine if a current translation entry is being used, use
the show ip nat statistics command to check the hits counter.
[Link]
ICND1 v1.01-25