Week 8 -Implementation of NAT in Cisco Packet Tracer

IMPLEMENTATION OF NAT IN CISCO PACKET TRACER


Network address translation (NATis a method of remapping one IP address space into another by modifying network address information in the IP header of packets while they are in transit across a traffic routing deviceThe main use of NAT is to limit the number of public IP addresses an organization or company must use, for both economy and security purposes.


NAT inside and outside addresses :

Inside refers to the addresses which must be translated. Outside refers to the addresses which are not in control of an organization. These are the network Addresses in which the translation of the addresses will be done.

·    Inside local address – An IP address that is assigned to a host on the Inside (local) network. The address is probably not a IP address assigned by the service provider i.e., these are private IP address. This is the inside host seen from the inside network.
·       Inside global address – IP address that represents one or more inside local IP addresses to the outside world. This is the inside host as seen from the outside network.
·       Outside local address – This is the actual IP address of the destination host in the local network after translation.
·       Outside global address – This is the outside host as seen form the outside network. It is the IP address of the outside destination host before translation.

Network Address Translation (NAT) Types:

  • Static NAT:
In this, a single unregistered (Private) IP address is mapped with a legally registered (Public) IP address i.e. one-to-one mapping between local and global address. This is generally used for Web hosting. These are not used in organizations as there are many devices who will need Internet access and to provide Internet access, public IP address is needed.

Suppose, if there are 3000 devices who needs access to Internet, the organization have to buy 3000 public addresses that will be very costly.

  • Dynamic NAT:
In this type of NAT, an unregistered IP address is translated into a registered (Public) IP address from a pool of public IP address. If the IP address of pool are not free, then the packet will be dropped as only fixed number of private IP address can be translated to public addresses.

Advantages of NAT:

·        NAT conserves legally registered IP addresses .
·    It provides privacy as the device IP address, sending and receiving the traffic, will be  hidden.
·        Eliminates address renumbering when a network evolves.

Disadvantage of NAT:

·         Translation results in switching path delays.
·         Certain applications will not function while NAT is enabled.
·         Complicates tunneling protocols such as IP sec.


CONFIGURATION:

TOPOLOGY:

Figure 7.1



Create a n/w topology as shown in Figure 7.1. I have taken 3 PCs with IP address as 10.0.0.10, 10.0.0.20, 10.0.0.30. These PCs are connected to a switch which is connected to a router Router4 with gig 0/1. The interface IP address of gig 0/1 is10.0.0.1. The Router4 is connected to Router5 via a serial ports se 0/1/0 in both the routers.
The interface IP address for Router4 at se 0/1/0 is 100.0.0.1. The interface IP address for Router5 at se 0/1/0 is 100.0.0.2. Router5 is connected to a server whose IP address is 192.168.1.10 via gig 0/0 port whose interface IP address is192.168.1.1.

Now run the following commands as below to setup static NAT.


ON ROUTER 4:
Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int gig 0/1
Router(config-if)#ip address 10.0.0.1 255.0.0.0
Router(config-if)#no shut
Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/1, changed state to up
Router(config-if)#int se 0/1/0
Router(config-if)#ip address 100.0.0.1 255.0.0.0
Router(config-if)#no shut

%LINK-5-CHANGED: Interface Serial0/1/0, changed state to down
Router(config-if)#
Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up

Router(config-if)#exit
Router(config)#ip nat inside source static 10.0.0.10 50.0.0.10
Router(config)#int gig 0/1
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#int se 0/1/0
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#ip nat inside source static 10.0.0.20 50.0.0.20
Router(config)#ip nat inside source static 10.0.0.30 50.0.0.30
Router(config)#exit
Router(config)#ip route 200.0.0.0 255.255.255.0 100.0.0.2
Router(config)#exit

ON ROUTER 5:

Router>en
Router#config t
Enter configuration commands, one per line. End with CNTL/Z.
Router(config)#int gig 0/0
Router(config-if)#ip address 192.168.1.1 255.255.255.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
Router(config-if)#int se 0/1/0
Router(config-if)#ip address 100.0.0.2 255.0.0.0
Router(config-if)#no shut

Router(config-if)#
%LINK-5-CHANGED: Interface Serial0/1/0, changed state to up

Router(config-if)#
%LINEPROTO-5-UPDOWN: Line protocol on Interface Serial0/1/0, changed state to up

Router(config-if)#ip nat inside source static 192.168.1.10 200.0.0.10
Router(config)#int gig 0/0
Router(config-if)#ip nat inside
Router(config-if)#exit
Router(config)#int se 0/1/0
Router(config-if)#ip nat outside
Router(config-if)#exit
Router(config)#ip route 50.0.0.0 255.0.0.0 100.0.0.1
Router(config)#exit

NAT Successful:


NAT successful via ping

Comments

Popular posts from this blog

Week 10 - Programming UDP Sockets in Node.js

Week 6 Implementation of DHCP in CISCO Packet Tracer

Week 1 - Introduction to Cisco Packet tracer