0% found this document useful (0 votes)
22 views

Lab - NAT Configuration

Uploaded by

Sabahat Jaffar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Lab - NAT Configuration

Uploaded by

Sabahat Jaffar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

PAK AUSTRIA FACHHOCHSCHULE: INSTITUTE OF APPLIED SCIENCES AND

TECHNOLOGY
DEPARTMENT OF ELECTRICAL AND COMPUTER ENGINEEING

Computer Networks
COMP-352L

LAB TASK 8

School of Computing Sciences

Prepared by:
Laiba Sohail
Network Address Translation (NAT) Configuration
Overview:
What is Network Address Translation (NAT)?
A process in which one or more local IP address is translated into one or more Global IP address
and vice versa in order to provide Internet access to the local hosts.
Also, it does the translation of port numbers i.e. masks the port number of the host with another port
number, in the packet that will be routed to the destination. It then makes the corresponding entries
of IP address and port number in the NAT table. NAT generally operates on a router or firewall.
Working of Network Address Translation (NAT):
 Border router is typically configured for NAT
 Converts local (private) IP address to global (public) IP address when packet leaves local
network
 Converts global (public) IP address to local (private) IP address when packet enters local
network
Why mask port numbers?
 Prevents confusion when multiple hosts request the same destination on the same port
 Allows NAT to distinguish between different hosts' requests
Network Address Translation (NAT) Types:
1. Static NAT
2. Dynamic NAT
3. PAT (Port Address Translation):

Static NAT (Network Address Translation) - 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.
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.
PAT (Port Address Translation) - Port Address Translation (PAT) is another type of dynamic
NAT which can map multiple private IP addresses to a single public IP address by using a
technology known as Port Address Translation.
Here when a client from inside network communicates to a host in the internet, the router changes
the source port (TCP or UDP) number with another port number. These port mappings are kept in a
table. When the router receives from internet, it will refer the table which keep the port mappings
and forward the data packet to the original sender.

Prepared By: Laiba Sohail Page 2


Steps:
Step 1: Set up the network topology
1. Add Devices:
o 2 Routers from network devices.
o 1 Switch from network devices.
o 3 PCs from end devices.
2. Connect Devices:
o Use straight-through cables to connect PC1, PC2, and PC3 to the switch.
o Connect the switch to Router 01's GigabitEthernet0/0/1 using a straight-through
cable.
o Connect Router 01's GigabitEthernet0/0/0 to Router 02's GigabitEthernet0/0/0 using
a Cross-over cable.

Prepared By: Laiba Sohail Page 3


Computer Networks

Step 2: Configure IP addresses on PCs


 Open the Desktop tab of each PC, click on IP Configuration, and assign the following IP
addresses:
o PC1:
 IP: 10.0.0.1
 Subnet Mask: 255.255.255.0
 Gateway: 10.0.0.100
o PC2:
 IP: 10.0.0.2
 Subnet Mask: 255.255.255.0
 Gateway: 10.0.0.100
o PC3:
 IP: 10.0.0.3
 Subnet Mask: 255.255.255.0
 Gateway: 10.0.0.100
Step 3: Configure Router 01 (Internal Network)
1. Access Router 01 by clicking it and entering the CLI.
2. Configure the inside (LAN) interface:
Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet0/0/1
Router(config-if)# ip address 10.0.0.100 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
3. Configure the outside (WAN)
Router(config)# interface GigabitEthernet0/0/0
Router(config-if)# ip address 212.100.100.2 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
4. Save the running configuration:
Router# copy running-config startup-config
Step 4: Configure Router 02 (External Network)
1. Access Router 02 by clicking it and entering the CLI.
2. Configure the interface connecting to Router 01:
Router> enable
Router# configure terminal
Router(config)# interface GigabitEthernet0/0/0
Router(config-if)# ip address 212.100.100.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# exit
3. Save the running configuration:
Router# copy running-config startup-config
Step 5: NAT and PAT Configuration on Router 01
1. Access Router 01 via CLI.
2. Create an Access Control List (ACL) to permit traffic from the internal network
(10.0.0.0/24):
Router(config)# access-list 10 permit 10.0.0.0 0.0.0.255
3. Define the NAT pool (for dynamic IP translation). In this case, since we're using Port
Address Translation (PAT), you only need one global IP:
Router(config)# ip nat pool CNLAB 121.52.150.10 121.52.150.10 netmask 255.0.0.0
4. Configure NAT Overload (PAT) to allow multiple internal hosts to use one external IP:
Router(config)# ip nat inside source list 10 pool CNLAB overload
5. Assign the inside interface for NAT:
Router(config)# interface GigabitEthernet0/0/1
Router(config-if)# ip nat inside
Router(config-if)# exit
6. Assign the outside interface for NAT:
Router(config)# interface GigabitEthernet0/0/0
Router(config-if)# ip nat outside
Router(config-if)# exit
7. Save the running configuration:
Router# copy running-config startup-config
Step 6: Testing the Configuration
1. Ping Test: From PC1, PC2, and PC3, open the Command Prompt and ping the external IP
212.100.100.1 (Router 02). The ping should succeed, confirming that NAT is working.
2. Verify NAT Table: In Router 01, verify the NAT translations by using: Router# show ip
nat translations.
3. This should display the internal IP addresses mapped to the external IP address with
different port numbers, confirming the PAT configuration.
Expected End Result:
 Network Functionality: The PCs in the local network should successfully communicate
with an external network (internet simulation) through Router 01, which will perform
Network Address Translation (NAT).

Prepared by: Laiba Sohail Page 5


Prepared by: Laiba Sohail Page 6
 NAT Table Entries: The NAT table on Router 01 will maintain records of the internal
private IP addresses and port numbers, translating them to the public IP address (with
PAT).
 Packet Flow: Outgoing packets from the local network will have their private IP
addresses and source port numbers translated into a public IP address and different port
numbers, allowing successful communication with external networks. Incoming
responses will be correctly mapped back to the original private IP addresses and ports.
 Verification: Successful pings from any of the PCs to an external network IP
(represented by Router 02) will verify that NAT is functioning correctly.

TASK:
Perform NAT configuration and attach screenshots of each step.
Screenshot should be of full computer screens.

Prepared by: Laiba Sohail Page 7

You might also like