In modern network architecture, public-facing servers such as web or mail servers must be accessible from the internet while maintaining a secure internal perimeter. Static Network Address Translation (NAT) is the industry-standard method for mapping specific external IP addresses and ports to internal private hosts. This hands-on project guides IT students and junior engineers through configuring static NAT port forwarding on Cisco routers using Packet Tracer or GNS3. We will explore subnetting, VLAN segmentation, routing protocols, and verification techniques using tools like Wireshark.
Understanding Static NAT vs. Dynamic NAT
Before touching the configuration, it is crucial to distinguish between dynamic and static NAT. Dynamic NAT maps internal private IP addresses to a pool of public IPs on a first-come, first-served basis. This is unsuitable for servers that require a consistent external address. Static NAT creates a one-to-one permanent mapping. In this project, we will map a specific port (e.g., TCP 80) on the router’s external interface to a private server IP on the internal network.
This approach ensures that inbound traffic destined for 203.0.113.5:80 is strictly forwarded to 192.168.10.50. Without this configuration, packets arriving at the public IP would be dropped by the router because they do not match any active stateful connection table entries.
Lab Scenario and Prerequisites
To complete this project successfully, you need a simulated network environment. We will assume a standard enterprise topology involving two VLANs connected via a Layer 3 switch or router-on-a-stick configuration.
Lab Topology Requirements:
* External Interface: Router GigabitEthernet0/0 (Public IP: 203.0.113.5/29).
* Internal Interface: Router GigabitEthernet0/1 (Private Gateway: 192.168.10.1/24).
* Server Host: Connected to VLAN 10, IP 192.168.10.50.
* Client Host: Connected to VLAN 20, used for external access simulation.
* Tools: Cisco Packet Tracer (recommended for beginners) or GNS3/EVE-NG for advanced realism.
Prerequisites:
* Familiarity with basic IOS commands (enable, configure terminal).
* Understanding of subnet masks and VLAN tagging.
* Access to a computer running the chosen emulation software.
Step-by-Step Configuration Guide
Follow these numbered steps to configure the router, ensuring each command is explained for educational clarity.
1. Define Interface IP Addresses and Subnetting
First, assign IP addresses to the router interfaces. Ensure the external interface has a public IP and the internal interface acts as the default gateway for the private subnet.
Router> enable
Router# configure terminal
Router(config)# hostname RTR-CORE
RTR-CORE(config)# interface GigabitEthernet0/0
RTR-CORE(config-if)# ip address 203.0.113.5 255.255.255.248
RTR-CORE(config-if)# no shutdown
RTR-CORE(config-if)# exit
RTR-CORE(config)# interface GigabitEthernet0/1
RTR-CORE(config-if)# ip address 192.168.10.1 255.255.255.0
RTR-CORE(config-if)# no shutdown
What this does: This establishes the boundary between the public internet and the private LAN. The /29 mask on the external interface provides only five usable IPs, simulating a constrained ISP allocation common in real-world scenarios.
2. Configure Static NAT Port Forwarding
This is the core of the project. We will use the ip nat inside source static tcp command to map a specific port.
RTR-CORE(config)# ip nat inside source static tcp 192.168.10.50 80 203.0.113.5 80
Command Breakdown:
* ip nat inside source: Tells the router to perform NAT on traffic moving from the inside (private) to the outside (public).
* static tcp: Defines a permanent TCP mapping.
* 192.168.10.50 80: The local host IP and the local port.
* 203.0.113.5 80: The global (public) IP and the global port.
Expected Result: Traffic hitting 203.0.113.5:80 is rewritten to 192.168.10.50:80. If you were mapping a different external port (e.g., 8080) to the internal web server’s port 80, the command would look like this:
ip nat inside source static tcp 192.168.10.50 80 203.0.113.5 8080
3. Designate Inside and Outside Interfaces
The router must know which interface faces the internet and which faces the private network.
RTR-CORE(config)# interface GigabitEthernet0/0
RTR-CORE(config-if)# ip nat outside
RTR-CORE(config-if)# exit
RTR-CORE(config)# interface GigabitEthernet0/1
RTR-CORE(config-if)# ip nat inside
RTR-CORE(config-if)# exit
4. Enable IP Routing and Basic Connectivity
Ensure the router can route packets between the VLANs. If using OSPF or EIGRP, configure them here; otherwise, static routes suffice for a simple lab.
RTR-CORE(config)# ip routing
RTR-CORE(config)# ip route 0.0.0.0 0.0.0.0 Serial0/0/0
(Note: Replace Serial0/0/0 with your actual default gateway interface for internet exit).
Verification and Troubleshooting with Wireshark
Configuration is only half the battle; verification ensures security and functionality. Use show ip nat translations to view the active mapping table. A successful configuration will display an entry showing the inside local address paired with the inside global address.
To verify packet flow, capture traffic on the external interface using Wireshark.
1. Generate a ping or HTTP request from the client to the public IP 203.0.113.5.
2. Filter Wireshark by ip.addr == 203.0.113.5.
3. Inspect the TCP flags and source/destination ports. You should see the destination port change from 80 (public) to 80 (private) after passing through the router, confirming the translation occurred.
Common Errors and Fixes:
* Error: “No route to host.”
* Fix: Verify that a default route or specific static routes exist on the router pointing toward the ISP gateway.
* Error: NAT translations do not appear.
* Fix: Ensure ip nat inside and ip nat outside are correctly applied to the respective interfaces. Also, check if an ACL (Access Control List) is blocking the traffic before it reaches the NAT process.
* Error: Connection reset by peer.
* Fix: The server itself might have a firewall (iptables on Linux or Windows Firewall) blocking the incoming connection from the router’s internal interface. Ensure the server accepts connections from 192.168.10.1.
Student Practice Task: Secure Email Server Access
For students aiming to master this skill, try the following extension task:
Configure a second static NAT rule for port 443 (HTTPS) mapping to a different internal server IP (192.168.10.51). Then, create an ACL that denies all other traffic to the external IP except for ports 80 and 443. This simulates a “default deny” security posture often required in industry compliance standards.
RTR-CORE(config)# access-list 100 permit tcp any host 203.0.113.5 eq 443
RTR-CORE(config)# ip nat inside source static tcp 192.168.10.51 443 203.0.113.5 443 acl 100
Industry Application and Conclusion
In a professional environment, Static NAT is frequently used alongside DNS records to ensure that www.example.com always resolves to the correct public IP regardless of carrier changes. However, practitioners must remember that Static NAT exposes internal services directly to the internet, making it a high-value target for attackers.
Best practices include:
1. Principle of Least Privilege: Only open necessary ports (e.g., 80, 443) and never expose administrative ports like SSH (22) or RDP (3389) directly via static NAT unless strictly required and heavily firewalled at the host level.
2. Logging: Enable logging on NAT translations to monitor for scanning attempts: ip nat inside source log.
3. Fail-Safe Defaults: Always configure an implicit deny policy on edge firewalls behind the NAT router.
By completing this project, you have gained practical experience in subnetting, VLAN management, and secure perimeter configuration. Remember that while Packet Tracer simplifies these concepts, real-world Cisco IOS XE versions may require slight syntax variations or additional license checks for advanced features. Always verify specific command availability against your router’s feature set documentation before deploying to production networks.
Educational-use notice: This tutorial is for learning and controlled lab use only. Test carefully, use backups, and obtain authorization before making changes. Do not run unfamiliar commands on production systems. We accept no responsibility for misuse, damage, data loss, or production issues.

