week 9 to 10-9
week 9 to 10-9
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Contents
Khwaja Fareed University of Engineering & Information Technology, Abu Dhabi Road, Rahim Yar Khan. Tel: +92 68 5882400, +92 68 5882432, Fax: +92 68 5882405, www.kfueit.edu.pk
Network Address
Translation (NAT)
The process of translating one IP address to another is known as
Network Address Translation, or NAT.
Suppose, in a network, two hosts A and B are connected. Now, both of them request for the same destination, on the same port number, say
1000, on the host side, at the same time. If NAT does only translation of IP addresses, then when their packets will arrive at the NAT, both
of their IP addresses would be masked by the public IP address of the network and sent to the destination. Destination will send replies to
the public IP address of the Router. Thus, on receiving a reply, it will be unclear to NAT as to which reply belongs to which host (because
source port numbers for both A and B are the same). Hence, to avoid such a problem, NAT masks the source port number as well and
makes an entry in the NAT table.
NAT Terminologies
• Inside local address – An IP address that is assigned to a host on the Inside (local) network. The address is probably not an IP address assigned by the
service provider i.e., these are private IP addresses. This is the inside host seen from the inside network.
• Inside global address – IP address that represents one or more inside local IP addresses to the outside world. This is the inside host as seen from the
outside network.
• Outside local address – This is the actual IP address of the destination host in the local network after translation.
• Outside global address – This is the outside host as seen from the outside network. It is the IP address of the outside destination host before translation.
NAT Types
• Static NAT
• Static PAT
• Dynamic NAT
• NAT Overload / Port Address Translation
Static NAT
Static NAT – performs a static one-to-one translation
between two addresses, or between a port on one
address to a port on another address. Static NAT is
most often used to assign a public address to a device
behind a NAT-enabled firewall/Router.
Static PAT
• According to the definitions outlined in the NAT Terminology article, a Static PAT implies a translation of the IP address and Port,
where the post-translation attributes are explicitly defined.
• There are multiple use cases for a Static PAT, but they all have one thing in common – a need to manually change the TCP or UDP
port as a packet moves through a Router or firewall.
Multiple Servers using one Public IP Address
• One specific use case for Static PAT is to use a single Public IP address to host multiple services on different internal servers. This
is in contrast with a Static NAT which would only allow you to use a single Public IP address to host multiple services on
the same server.
• This illustration will show how Static PAT can enable the single IP address 73.8.2.44 to host two different services (HTTP and
HTTPS) using two separate internal servers (10.4.4.41 and 10.4.4.42):
Dynamic NAT – utilizes a pool of global addresses
to dynamically translate the outbound traffic of
Dynamic NAT clients behind a NAT-enabled device.
PAT translates the outbound traffic of clients to unique port
NAT Overload numbers of a single global address. PAT is necessary when
the number of internal clients exceeds the available global
/ PAT addresses.
NAT Summary
• NAT-Device(config)# int f0/0
•
Static NAT •
NAT-Device(config-if)# ip nat inside
NAT-Device(config)# int f0/1
•
Configuration •
NAT-Device(config-if)# ip nat outside
NAT-Device(config)# ip nat inside source static 172.16.1.1 158.80.1.40
•
• NAT-Device(config)# int f0/0
• NAT-Device(config-if)# ip nat inside
Dynamic NAT • NAT-Device(config)# int f0/1
• NAT-Device(config-if)# ip nat outside
Configuration • NAT-Device(config)# ip nat pool POOLNAME 158.80.1.1 158.80.1.50 netmask
255.255.255.0
• NAT-Device(config)# access-list 10 permit 172.16.1.0 0.0.0.255
• NAT-Device(config)# ip nat inside source list 10 pool POOLNAME
• NAT-Device(config)# int f0/0
• NAT-Device(config-if)# ip nat inside
NAT Overload • NAT-Device(config)# int f0/1
• NAT-Device(config-if)# ip nat outside
• NAT-Device(config)# ip nat pool POOLNAME 158.80.1.1 158.80.1.50 netmask
Configuration 255.255.255.0
• NAT-Device(config)# access-list 10 permit 172.16.1.0 0.0.0.255
• NAT-Device(config)# ip nat inside source list 10 pool POOLNAME overload
NAT Troubleshoot
•To view whether an interface is configure as an inside or outside NAT interface, and
to display statistical information regarding active NAT translations:
NAT-Device# show ip nat statistics
•To clear all dynamic NAT entries from the translation table:
NAT-Device# clear ip nat translation