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...

Configuration of Routing Information Protocol

Configuration of Routing Information Protocol Routing Information Protocol  ( RIP ) is a dynamic  routing protocol  which uses hop count as a  routing  metric to find the best path between the source and the destination network. It is a distance vector  routing protocol  which has AD value 120 and works on the application layer of OSI model.  RIP  uses port number 520. Features of RIP 1. Updates of the network are exchanged periodically. 2. Updates (routing information) are always broadcast. 3. Full routing tables are sent in updates. 4. Routers always trust on routing information received from neighbor routers. This is also known as  Routing on rumours . RIP versions :  There are three vesions of routing information protocol –  RIP Version1 ,  RIP Version2  and  RIPng . RIP v1  is known as  Classful  Routing Protocol because it doesn’t send information of subnet mask in...