Network Address Translation (NAT)


Today we will talk about NAT.  Network address translation (NAT) is the process by which one or more local private IP address pairs are translated into one or more global (public) IP addresses.  This is done so that the local host is given the facility of internet access.  NAT usually works on the router or firewall ie it is configured in it.



How work NAT 

Now let's talk about its working, most of the router's border is configured for NAT.  This means that such a router, which has one interface in the local ie the inside network and one interface is in the global network ie the outside world.


 When a packet is sent from local network ie from inside, then NAT translates that local ie private IP address into global i.e. public IP address and only its translated address is visible to the outside world.  .


 But when the packet comes in the local network ie the key comes inwards, then the work of converting the global i.e. public IP address to local i.e. private IP address is done.


 If the NAT does not have an address to provide, it means that there is no address left in the configured pool, and the packet is then dropped and notified by sending an Internet Control Message Protocol (ICMP) message.  that the destination cannot be reached yet.

Network Address Translation (NAT) working

By and large, the line switch is arranged for NAT i.e the switch which has one connection point in the neighborhood (inside) organization and one point of interaction in the worldwide (outside) organization. At the point when a bundle cross external the nearby (inside) organization, then NAT changes over that neighborhood (private) IP address to a worldwide (public) IP address. At the point when a parcel enters the nearby organization, the worldwide (public) IP address is changed over completely to a neighborhood (private) IP address.

In the event that NAT runs out of addresses, i.e., no location is left in the pool designed then the parcels will be dropped and an Internet Control Message Protocol (ICMP) have inaccessible bundle to the objective is sent.

Network Address Translation (NAT) Types

There are three types of NAT

1-static network address translation
2-dynamic network address translation
3-  port address translation

 Static NAT configuration

In this, a solitary unregistered (Private) IP address is planned with a legitimately enrolled (Public) IP address i.e coordinated planning among nearby and worldwide addresses. This is for the most part utilized for Web facilitating. These are not utilized in that frame of mind there are numerous gadgets that will require Internet access and to give Internet access, a public IP address is required.
Assume, on the off chance that there are 3000 gadgets that need admittance to the Internet, the association needs to purchase 3000 public tends to that will be exorbitant.

In Static NAT, for each host, the public IP address of each in the router will be configured. If a public IP 142.1.1.1 is given for host 1, this IP will be used only by host 1 and no one else can, so each host in this  One by one configuration has to be done for





Configuration of IP address

 R1
1-open terminal type enable and press enter 
R1#
R1# configure terminal and press enter
R1(config)# interface gig 0/1 and press enter
R1(config-if)# ip address 10.0.0.1 255.0.0.0 and press enter 
R1(config-if)#exit
R1(config) interface gig 0/0
R1(config-if)# ip address 142.1.1.10 255.255.0.0


R2
1-open terminal type enable and press enter 
R2#
R2# configure terminal and press enter
R2(config)# interface gig 0/0 and press enter
R2(config-if)# ip address 142.1.1.1 255.255.0.0 and press enter 
R2(config-if)#exit
R2(config) interface gig 0/1
R2(config-if)# ip address 11.1.1.1 255.255. 255.0


R3
1-open terminal type enable and press enter 
R3#
R3# configure terminal and press enter
R3(config)# interface gig 0/1 and press enter
R3(config-if)# ip address 11.1.1. 2 255.255. 255.0 and press enter 
R3(config-if)#exit
R3(config) interface gig 0/1
R3(config-if)# ip address 12.1.1.1 255.255. |


dynamic routing

Now for this, we will do routing between these routers, now what is this routing, then by which way the router has to go from one network to another and it is done to keep the information of the network around it. Routing is of two types.  Static and Dynamic.

 Static routing is done for small networks, in which the route is fixed in advance, if that route fails, then our communication will fail, while on the other hand, there is no route fixed for dynamic, which will get the shortest route.  Here we will configure RIP in Dynamic



RIP configuration

R1
1-open terminal type enable and press enter 
R1#
R1# configure terminal and press enter
R1(config)# router rip
R1(config-router)# network 10.0.0.0 255.
R1(config-router)# network 142.1.0.0
R1(config-if)#exit
R2
1-open terminal type enable and press enter 
R2#
R2# configure terminal and press enter
R2(config)# router rip
R2(config-router)#network 142.1.0.0 
R2(config)# network 11.1.1.0 


R3
1-open terminal type enable and press enter 
R3#
R3# configure terminal and press enter
R3(config)#router rip
R3(config-router)# network 11.1.1.0 
R3(config-router)# network 12.1.1.0


Static nat configuration

R1
First go to configuration mode
R1(config)# ip nat inside source static 10.0.0.2 (host IP address) 142.1.1.1 (public IP address for Host) and press enter

Step 2

R1(config-if)# int gig 0/1 and press enter
R1(config-if)#ip nat inside and press enter
R1(config-if)# int gig 0/0 and press enter
 R1(config-if)#ip nat outside press enter

Video


Dynamic NAT configuration

Dynamic NAT

In dynamic net, no IP is assigned to a particular host, rather an access list is created and all the hosts in that access list act according to the bridge public IP is created for.  If an access list is 50 hosts and the pool created has only 5 public IPs, then any 5 out of 50 hosts can simultaneously use these 5 public IPs.

R1

Step 1

Go to configuration mode and type

 R1(config)#   Access-list 1 permit 10.0.0.0  0.255.255.255 and press enter

Step 2

R1(config)# Ip nat pool Cisco 142.1.1.1 142.1.1.4 netmask 255.255.0.0 and press enter

Step 3

R1(config)# Ip nat inside source list 1 pool Cisco and press enter

Step 4 

R1(config-if)#  int gig0/1 and press enter
R1(config-if)# ip nat inside and press enter
R1(config-if)# int gig0/0 and press enter
R1(config-if)#ip nat outside press enter 


Video 


Port address translation configuration 



PAT (port address translation)

Port address translation is like a dynamic protocol, only a bridge does not have to be built in it, the port is configured in this, as many wireless routers come nowadays, PAT configuration is done in it.

R1

R1(config-if)#int gig0/1 and press enter
R1(config-if)#ip nat inside and press enter
R1(config-if)#int gig0/0 and press enter
R1(config-if)#ip nat outside press enter 
 
R1(config)#  access-list 1 permit 10.0.0.2 0.255.255.255 and press enter

R1(config)# ip nat inside source list 1 int gig 0/0 overload

Advantages of NAT -


NAT saves lawfully enlisted IP addresses.

It gives security as the gadget's IP address, sending and getting the traffic, will be covered up.

Takes out address renumbering when an organization develops.

Disadvantage of NAT -


Interpretation brings about exchanging way delays.

Certain applications won't work while NAT is empowered.

Convolutes burrowing conventions like IPsec.

Likewise, the switch being an organization layer gadget, shouldn't mess with port numbers(transport layer) however it needs to do so in light of NAT.
I hope you enjoy this article