Nat
Nat
Nat
(NETWORK ADDRESS
TRANSLATION)
What is NAT?
• Network Address Translation (NAT) is the
process where a network device, usually a
firewall, assigns a public address to a
computer (or group of computers) inside a
private network. The main use of NAT is to
limit the number of public IP addresses an
organization or company must use, for both
economy and security purposes.
• Nat is used to translate private ip address to
public ips and public ip to private ip.
• (10.0.0.0 to 10.255.255.255, 172.16.0.0 to
172.31.255.255, or 192.168.0 0 to
192.168.255.255).
HOW NAT WORKS
NAT TYPES
• STATIC NAT
• DYNAMIC NAT
• PAT (Port Address Translation)
Static NAT (Network Address
Translation)
• Static NAT (Network Address Translation) is
one-to-one mapping of a private IP address to
a public IP address. Static NAT (Network
Address Translation) is useful when a network
device inside a private network needs to be
accessible from internet.
Dynamic NAT (Network Address
Translation)
Dynamic NAT can be defined as mapping of
a private IP address to a public IP address from a
group of public IP addresses called as NAT pool.
Dynamic NAT establishes a one-to-one mapping
between a private IP address to a public IP address.
Here the public IP address is taken from the pool of
IP addresses configured on the end NAT router. The
public to private mapping may vary based on the
available public IP address in NAT pool.
PAT (Port Address Translation)
• Port Address Translation (PAT) is another type of
dynamic NAT which can map multiple private IP
addresses to a single public IP address by using a
technology known as Port Address Translation.
• Here when a client from inside network communicate to
a host in the internet, the router changes the source port
(TCP or UDP) number with another port number. This
port mappings are kept in a table. When the router
receive from internet, it will refer the table which keep
the port mappings and forward the data packet to the
original sender
Term Explanation
Inside Addresses located on the inside of your network
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host r1
r1(config)#int fa0/0
r1(config-if)#ip nat inside
r1(config-if)#ip address 192.168.101.1 255.255.255.0
r1(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state
to up
r1(config-if)#ex
r1(config)#int se2/0
r1(config-if)#ip nat outside
r1(config-if)#ip address 192.168.1.1 255.255.255.0
r1(config-if)#clock rate 64000
r1(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to down
r1(config-if)#ip nat inside source static 192.168.101.2 192.168.1.1
r1(config)#router rip
r1(config-router)#network 192.168.1.0
r1(config-router)#network 192.168.101.0
Router 2:
Router>
Router>en
Router#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#host r2
r2(config)#int fa0/0
r2(config-if)#ip address 192.168.100.1 255.255.255.0
r2(config-if)#no shut
%LINK-5-CHANGED: Interface FastEthernet0/0, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state
to up
r2(config-if)#ex
r2(config)#int se2/0
r2(config-if)#ip address 192.168.1.2 255.255.255.0
r2(config-if)#no shut
%LINK-5-CHANGED: Interface Serial2/0, changed state to up
r2(config-if)#ex
r2(config)#router rip
r2(config-router)#network 192.168.1.0
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial2/0, changed state to up
r2(config-router)#network 192.168.100.0