CCNA – Dynamic NAT – Part – 4

2

Dynamic NAT

Unlike static NAT   Dynamic NAT uses a pool of public addresses and assigns them on a first-come, first-served basis. If you have 3 public address then it can translate 3 private ip address. But in this example we take 4 users to check what happen when all user want to communicate with server.Obviously one of then can’t communicate. Set server ip as 192.168.10.2 with default subnet mask 255.255.255.0. In this example we will use 202.65.10.32 to 202.65.10.34 as public ip.

dynamic nat1

Router>enable
Router#configure terminal
Router(config)#hostname R2
R2(config)#interface fastethernet 0/0
R2(config-if)#ip address 192.168.20.1 255.255.2555.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#interface fastethernet 0/1
R2(config-if)#ip address 192.168.30.1 255.255.2555.0
R2(config-if)#no shutdown
R2(config-if)#exit
R2(config)#ip route 0.0.0.0 0.0.0.0 fastethernet 0/1
R2(config)#access-list 10 permit 192.168.20.0 0.0.0.255
R2(config)#ip nat pool test 202.65.10.32 202.65.10.34 netmask 255.255.2555.0
R2(config)#ip nat inside source list 10 pool test
R2(config)#interface fastEthernet 0/0
R2(config-if)#ip nat inside
R2(config-if)#exit
R2(config)#interface fastEthernet 0/1
R2(config-if)#ip nat outside
R2(config-if)#exit
R2(config)#exit

R2#debug ip nat

now on Router3:

Router>en
Router#config t

Router(config)#hostname R3
R3(config)#int fastEthernet 0/1
R3(config-if)#ip address 192.168.30.2 255.255.255.0
R3(config-if)#no shut
R3(config-if)#exit
R3(config)#int fastEthernet 0/0
R3(config-if)#ip add
R3(config-if)#ip address 192.168.10.1 255.255.255.0
R3(config-if)#no shut

R3(config-if)#exit
R3(config)#ip route 0.0.0.0 0.0.0.0 fastEthernet 0/1

R3(config)#exit

If you check carefully you can see i mentioned debug command on R2 router. just on that command first and do ping to 192.168.10.2(Server ip) and you can see how translation process is working. like below

debug nat

or

use below command. i used this and getting as showing in report……

Router#sh ip nat translations
Pro  Inside global     Inside local       Outside local      Outside global
tcp 202.65.10.32:1025  192.168.20.4:1025  192.168.10.2:80    192.168.10.2:80
tcp 202.65.10.32:1026  192.168.20.4:1026  192.168.10.2:80    192.168.10.2:80
tcp 202.65.10.32:1027  192.168.20.4:1027  192.168.10.2:80    192.168.10.2:80
tcp 202.65.10.32:1028  192.168.20.4:1028  192.168.10.2:80    192.168.10.2:80

after watching this report you can off that debug command. Thanks……..

 

 

 

Share.

About Author

Chakraborty Prijus

Former Asst. Manager (IT) - MGH Group MCA (Masters in Computer Application) From Sikkim Manipal University India. Have 5 years experience In IT field.

2 Comments

  1. sorfuddin ahmad
    sorfuddin ahmad on

    I enjoy any kind of CCNA configuration & it’s useful in my future practical life if attach networking related job so dear thanks

Leave A Reply

Powered by themekiller.com