Skip to main content


Related image


Configuration of Static/Dynamic NAT in Cisco Router

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.
In order to configure NAT we have to understand four basic terms; inside local, inside global, outside local and outside global. These terms define which address will be mapped with which address.
Term : Description
  • Inside Local IP Address : Before translation source IP address located inside the local network.
  • Inside Global IP Address : After translation source IP address located outside the local network.
  • Outside Global IP Address: Before translation destination IP address located outside the remote network.
  • Outside Local IP Address : After translation destination IP address located inside the remote network.
To assign IP address in Laptop click Laptop and click Desktop and IP configuration and Select Static and set IP address.
To configure IP address in Router1 click Router1 and select CLI and press Enter key.
Two interfaces of Router1 are used in topology; FastEthernet0/0 and Serial 0/0/0.
Router 1
  • Router>enable
  • Router# configure terminal
  • Router(config)#hostname R1
  • R1(config)#interface FastEthernet0/0
  • R1(config-if)#ip address 10.0.0.1 255.0.0.0
  • R1(config-if)#no shutdown
  • R1(config-if)#exit
  • R1(config)#exit
  • R1#configure terminal
  • R1(config)#interface Serial0/0/0
  • R1(config-if)#ip address 100.0.0.1 255.0.0.0
  • R1(config-if)#no shutdown
  • R1(config-if)#exit
Router 2
  • Router>enable
  • Router#configure terminal
  • Router(config)#hostname R2
  • R2(config)#interface FastEthernet0/0
  • R2(config-if)#ip address 192.168.1.1 255.255.255.0
  • R2(config-if)#no shutdown
  • R2(config-if)#exit R2(config)#interface Serial0/0/0
  • R2(config-if)#ip address 100.0.0.2 255.0.0.0
  • R2(config-if)#no shutdown
  • R2(config-if)#exit
Static NAT configuration requires three steps:
1. Define IP address mapping
2. Define inside local interface
3. Define inside global interface
R1 Static NAT Configuration
  • R1(config)#ip nat inside source static 10.0.0.10 50.0.0.10
  • R1(config)#interface FastEthernet 0/0
  • R1(config-if)#ip nat inside
  • R1(config-if)#exit
  • R1(config)#interface Serial 0/0/0
  • R1(config-if)#ip nat outside
  • R1(config-if)#exit

similarly do,
  • R1(config)#ip nat inside source static 10.0.0.20 50.0.0.20
  • R1(config)#ip nat inside source static 10.0.0.30 50.0.0.30
R2 Static NAT Configuration
  • R2(config)#ip nat inside source static 192.168.1.10 200.0.0.10
  • R2(config)#interface FastEthernet 0/0
  • R2(config-if)#ip nat inside
  • R2(config-if)#exit
  • R2(config)#interface Serial 0/0/0
  • R2(config-if)#ip nat outside
  • R2(config-if)#exit
Configure static routing in R1
  • R1(config)#ip route 200.0.0.0 255.255.255.0 100.0.0.2
Configure static routing in R2
  • R2(config)#ip route 50.0.0.0 255.0.0.0 100.0.0.1
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.
Dynamic NAT configuration requires four steps: –
1. Create an access list of IP addresses which need translation
2. Create a pool of all IP address which are available for translation
3. Map access list with pool
4. Define inside and outside interfaces
R1 Dynamic NAT Configuration
  • R1#configure terminal
  • R1(config)#access-list 1 permit 10.0.0.10 0.0.0.0
  • R1(config)#access-list 1 permit 10.0.0.20 0.0.0.0
  • R1(config)#access-list 1 deny any
  • R1(config)#ip nat pool ccna 50.0.0.1 50.0.0.2 netmask 255.0.0.0
  • R1(config)#ip nat inside source list 1 pool ccna
  • R1(config)#interface FastEthernet 0/0
  • R1(config-if)#ip nat inside
  • R1(config-if)#exit
  • R1(config)#interface Serial0/0/0
  • R1(config-if)#ip nat outside
  • R1(config-if)#exit

R2 Dynamic NAT Configuration
  • R2>enable
  • R2#configure terminal
  • R2(config)#ip nat inside source static 192.168.1.10 200.0.0.10
  • R2(config)#interface Serial 0/0/0
  • R2(config-if)#ip nat outside
  • R2(config-if)#exit
  • R2(config)#interface FastEthernet 0/0
  • R2(config-if)#ip nat inside
  • R2(config-if)#exit
Configure static routing in R1
  • R1(config)#ip route 200.0.0.0 255.255.255.0 100.0.0.2
Configure static routing in R2
  • R2(config)#ip route 50.0.0.0 255.0.0.0 100.0.0.1
To test this setup click Laptop0 and Desktop and click Command Prompt.
  • Run ipconfig command.
  • Run ping 200.0.0.10 command.
  • Run ping 192.168.1.10 command

Comments

Popular posts from this blog

Packet Tracer Simulation – TCP and UDP Communications Part 1: Generate Network Traffic in Simulation Mode Step 1: Generate traffic to populate Address Resolution Protocol (ARP) tables.  Click MultiServer and click the Desktop tab > Command Prompt.  Enter the ping 192.168.1.255 command. This will take a few seconds as every device on the network responds to MultiServer.  Close the MultiServer window. Step 2: Generate web (HTTP) traffic.  Switch to Simulation mode.  Click HTTP Client and click the Desktop tab > Web Browser.  In the URL field, enter 192.168.1.254 and click Go. Envelopes (PDUs) will appear in the simulation window.  Minimize, but do not close, the HTTP Client configuration window. Step 3: Generate FTP traffic.  Click FTP Client and click the Desktop tab > Command Prompt.  Enter the ftp 192.168.1.254 command. PDUs will appear in the simulation window.  Minim...
Star Topology using HUB and Switch, IP configuration of end devices, show command, copy command, password setting, hostname setting Steps to Implement : Connect 5 PC’s to a switch through fast ethernet cables and connect the switch to a router using a Gigabyte ethernet cable. Assing an IP to all the PC’s i.e Topology     PC 0 – 192.168.1.1     PC 1 – 192.168.1.2     PC 2 – 192.168.1.3     PC 3 – 192.168.1.4     PC 4 – 192.168.1.5 3. Configure the router : Router>enable Router# configure terminal Router(config)#hostname R1 R1(config)#interface gig0/1 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#exit R1#configure terminal R1(config)#line console 0 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#exit R1(config)#enable password cisco R1(config)#hostname harsh hardik(config)#exit hardik#write h...