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...
Networking – SocketProgramming in TCP. Python provides two levels of access to network services. At a low level, you can access the basic socket support in the underlying operating system, which allows you to implement clients and servers for both connection-oriented and connectionless protocols. Python also has libraries that provide higher-level access to specific application-level network protocols, such as FTP, HTTP, and so on. What is Sockets? Sockets are the endpoints of a bidirectional communications channel. Sockets may communicate within a process, between processes on the same machine, or between processes on different continents. Sockets may be implemented over a number of different channel types: Unix domain sockets, TCP, UDP, and so on. The socket library provides specific classes for handling the common transports as well as a generic interface for handling the rest. Sockets have their own vocabulary − ...
IMPLEMENTATION OF DHCP IN CISCO PACKET TRACER The Dynamic Host Configuration Protocol (DHCP) is a  network management protocol  used on  UDP/IP  networks whereby a DHCP server dynamically assigns an  IP address  and other network configuration parameters to each device on a network so they can communicate with other IP networks. A DHCP server enables computers to request IP addresses and networking parameters automatically from the  Internet service provider  (ISP), reducing the need for a  network administrator  or a user to manually assign IP addresses to all network devices.In the absence of a DHCP server, a computer or other device on the network needs to be manually assigned an IP address, or to assign itself an  APIPA  address, which will not enable it to communicate outside its local subnet. DHCP can be implemented on networks ranging in size from  home networks  ...