Network Address Translation
Types of NAT
Static NAT
This NAT is used for servers in which one Live IP is directly mapped to one Local IP. This NAT will forward on the traffic for the Live IP to the Local PC in the n/w.
Port Base Static NAT :-- This NAT is also used for servers. It provides port-based access to the servers with the help of NAT.
Dynamic NAT using Pool
Dynamic NAT is used for clients, which want to access Internet. The request from multiple client IPs are translated with the Live IP obtained from the Pool. It is also called Pool Based Dynamic NAT.
\/
NAT + PAT
Command for Basic NAT
Router(config)#ip nat inside source list 30 interface serial 0
NAT is the feature that can be enable in a Router, Firewall
or a Pc. With the help of NAT, we are able to translate network layer addresses
that are IP addresses of packets. With the help of Port Address Translation, we
are also able to translate port no.s present in transport layer header.
Advantage
of NAT
There are two reasons due to which we use NAT:
(1) Conserve Live IP address
On
Internet, there are limited no of IP addresses. If our Pc wants to communicate
on Internet then it should have a Live IP address assigned by our ISP. So that
IP address request will depend on no. of PCs that we want to connect on
Internet. Due to this, there will be a lot of wastage in IP addresses. To
reduce wastage, we can share live IP addresses between multiple PCs with the
help of NAT.
(2) NAT
enhances the network security by hiding PC & devices behind NAT
Types of NAT
Static NAT
This NAT is used for servers in which one Live IP is directly mapped to one Local IP. This NAT will forward on the traffic for the Live IP to the Local PC in the n/w.
Port Base Static NAT :-- This NAT is also used for servers. It provides port-based access to the servers with the help of NAT.
Dynamic NAT using Pool
Dynamic NAT is used for clients, which want to access Internet. The request from multiple client IPs are translated with the Live IP obtained from the Pool. It is also called Pool Based Dynamic NAT.
Pool allotted => 200.1.1.0 – 15/28
Server
Static
=> 200.1.1.3 = 172.16.0.7
Port Based Static NAT
200.1.1.4:53 = 172.16.0.6
200.1.1.4:80 = 172.16.0.5
Client
Dynamic NAT
Pool =>
200.1.1.8 – 200.1.1.12/28
Local address => 172.16.0.X
Except
172.16.0.5
172.16.0.6
172.16.0.7
Configuring NAT
Router#conf ter
Router(config)#int serial 0
Router(config-if)#ip nat outside
Router(config-if)#int eth 0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#ip nat inside source static 172.16.0.7
200.1.1.3
Router(config)#ip nat inside source static tcp 172.16.0.5 80
200.1.1.4 80
Router(config)#ip nat inside source static udp 172.16.0.6 53
200.1.1.4 53
Router(config)#access-list 30 deny 172.16.0.5
Router(config)#access-list 30 deny 172.16.0.6
Router(config)#access-list 30 deny 172.16.0.7
Router(config)#access-list 30 permit any
Router(config)#ip nat pool abc 200.1.1.8 200.1.1.12
netmask 255.255.255.240
Router(config)#ip nat inside source list 30 pool
abc overload
\/
NAT + PAT
Command for Basic NAT
Router(config)#ip nat inside source list 30 interface serial 0
<exiting interface name>
To display NAT translation
Router#sh ip nat translations
(after ping any address, it shows ping details)
To clear IP NAT Translation
Router#clear ip nat Translation *