Lab Objective:
Learn how to configure Port Forwarding (Network Address Translation/NAT).
Lab Purpose:
With NAT, you have no easy way of ensuring outside hosts can connect to internal web servers or email severs on the correct port such as 80 and 110. Port forwarding solves this problem by ensuring the correct port is attached to the servers.
Lab Tool:
Packet Tracer
Lab Topology:
Please use the following topology to complete this lab exercise:
Lab Walkthrough:
Task 1:
Connect a server to the router with a crossover cable and at the other side a PC. The PC will browse to the web server and the router will perform port forwarding.
Task 2:
Set the IP configuration for the hosts. The Ethernet interfaces should be 172.16.1.2 and the default gateway 172.16.1.1 which will be the closest IP address of R0. Here it is on one host device:
And the PC:
Task 3:
Configure IP addressing on R0.
Router(config)#host R0
R0(config)#int g0/0
R0(config-if)#ip add 172.16.1.1 255.255.0.0
R0(config-if)#no shut
%LINK-5-CHANGED: Interface GigabitEthernet0/0, changed state to up
R0(config-if)#int g0/1
R0(config-if)#ip add 192.168.1.1 255.255.255.0
R0(config-if)#no shut
Task 4:
Ping the server and PC from the router to ensure IP connectivity.
R0#ping 172.16.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 172.16.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
R0#ping 192.168.1.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 0/0/1 ms
Task 5:
The http service is turned on by default on Packet Tracer servers, so all we need to do now is add the port forwarding and NAT configurations to the router. We want incoming connections on port 80 for IP 10.0.0.2 to be forwarded to the web server’s IP of 172.16.1.2.
R0(config)#ip nat inside source static tcp 172.16.1.2 80 10.0.0.2 80 R0(config)#int g0/0
R0(config-if)#ip nat inside
R0(config-if)#int g0/1
R0(config-if)#ip nat outside
R0(config-if)#end
Task 6:
Test your configuration by connecting to 10.0.0.2 from the web browser on the PC. We won’t add any DNS to this lab to keep it simple.
We can connect to the web server from its outside address.
Task 7:
Check the NAT table on the router. Bear in mind that the source port won’t usually be 80, but the destination port will be. That’s what’s important.
R0#show ip nat tran
Pro Inside global Inside local Outside local Outside global
tcp 10.0.0.2:80 172.16.1.2:80 — —
tcp 10.0.0.2:80 172.16.1.2:80 192.168.1.2:1029 192.168.1.2:1029
tcp 10.0.0.2:80 172.16.1.2:80 192.168.1.2:1030 192.168.1.2:1030
Notes:
You would use port forwarding for web and email servers, live chat, gaming, and many other port-dependent services and protocols.




