CCNA Class 17 : About NAT & PAT
Introduction of NAT
Network Address Translation (NAT) is a method used by network devices, such as routers, to translate bunches of private IP addresses of devices to a single Public IP address in order to communicate with the internet.
There are Different types of NAT - Static NAT & Dynamic NAT
Work Functionality of NAT
- Inside local address—The IP address assigned to a host on the inside network. This is the address configured as a parameter of the computer OS or received via dynamic address allocation protocols such as DHCP. The address is likely not a legitimate IP address assigned by the Network Information Center (NIC) or service provider.
- Inside global address—A legitimate IP address assigned by the NIC or service provider that represents one or more inside local IP addresses to the outside world.
- Outside local address—The IP address of an outside host as it appears to the inside network. Not necessarily a legitimate address, it is allocated from an address space routable on the inside.
- Outside global address—The IP address assigned to a host on the outside network by the host owner. The address is allocated from a globally routable address or network space.
- NAT conserves legally registered IP addresses.
- It provides privacy as the device’s IP address, sending and receiving the traffic, will be hidden.
- Eliminates address renumbering when a network evolves.
- Translation results in switching path delays.
- Certain applications will not function while NAT is enabled.
- Complicates tunneling protocols such as IPsec.
- Also, the router being a network layer device, should not tamper with port numbers(transport layer) but it has to do so because of NAT.
Introduction of PAT
How PAT Works
- Device Sends a Packet:
- A device in the private network sends data to a destination on the internet.
- The packet contains the private IP address of the device and the source port of the application.
- Router Modifies the Packet:
- The router replaces the device's private IP address with the public IP address assigned to the routers.
- The router also assigns a unique source port number from its available pool. This combination of the public IP and a unique port number allows the router to distinguish between multiple internal devices.
- Mapping is Stored in a Table:
- The router keeps a translation table (a mapping of private IP and port to public IP and port) to ensure that return traffic is correctly routed back to the originating device.
- Packet Sent to the Internet:
- The modified packet is sent to the destination on the internet.
- Return Traffic:
- When the server responds, the router checks its translation table to determine the private IP and port corresponding to the public IP and port used in the response.
- The router modifies the destination IP and port of the packet back to the original private IP and port before delivering it to the device.
Advantages of PAT
- Efficient IP Address Usage: Multiple devices can share a single public IP.
- Enhanced Security: Private IP addresses are hidden from the outside world, reducing the attack surface.
- Cost-Effective: Organizations and individuals do not need multiple public IP addresses for each device.
NAT Configuration
Static NAT Configuration:
https://drive.google.com/file/d/1G7rwTMp6jn3F4PUP8nuKVDvM7ZCKlRhn/view?usp=sharing
Dynamic NAT Configuration:
https://drive.google.com/file/d/14y0mB8U16gtCcbsYgoMy6mssds4RxOhf/view?usp=sharing
How to Configure Static NAT
Step-01: Basic Router and PC Configuration
Step-02: Configure the Static NAT
Step-03: Configure the Static Routing
Step-04: Verify the NAT
How to Configure Dynamic NAT
Step-01: Configure the IP Access List and Dynamic NAT as Inside (Local & Remote Router)
Inside_R(config)#access-list 1 permit 10.0.0.20 0.0.0.0
Inside_R(config)#access-list 1 deny any
Inside_R(config)#ip nat pool ccna 100.0.0.10 100.0.0.11 netmask 255.255.255.0
Inside_R(config)#ip nat inside source list 1 pool ccna overload
Inside_R(config)#interface gigabitEthernet 0/0
Inside_R(config-if)#ip nat inside
Inside_R(config-if)#int se0/0/0
Inside_R(config-if)#ip nat outside
Outside_R(config)#int se0/0/0
Outside_R(config-if)#ip nat outside
Outside_R(config)#ip nat inside source static 8.8.8.8 200.0.0.10
Outside_R(config)#int gi0/0
Step-02: Static Routing Configuration
Inside_R(config)#ip route 8.8.8.0 255.255.255.0 172.31.0.2
Step-03: Dynamic NAT Configuration as Outside for Both Routers
Outside_R(config)#ip nat pool ccna 100.0.0.10 100.0.0.11 netmask 255.255.255.0
Outside_R(config)#ip access-list standard 1
Outside_R(config-std-nacl)#permit 10.0.0.10 0.0.0.0
Outside_R(config-std-nacl)#permit 10.0.0.20 0.0.0.0
Outside_R(config-std-nacl)#deny any
Outside_R(config)#ip nat outside source list 1 pool ccna
Method of PAT Configuration
To configure PAT, the following processes are required:
- configure the router’s inside interface using the ip nat inside command.
- configure the router’s outside interface using the ip nat outside command.
- configure an access list that includes a list of the inside source addresses that should be translated.
- enable PAT with the ip nat inside source list ACL_NUMBER interface TYPE overload global configuration command

.jpg)





Comments
Post a Comment
Thanks