network address translation (hindi) - How NAT works with example? - What is the difference between Pat and Nat? - Network address Translation tutorial

What is network address translation

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.


Types of NAT 

There are three types of NAT

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

 Static NAT configuration

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

I hope you enjoy this article


dynamic nat configuration |- 
static nat configuration in packet tracer|
PAT configuration in packet tracer
how nat work  |
nat translate|
telesales meaning in hindi|