Static NAT with Service-Specific Mapping

August 12, 2025 - Reading time: 3 minutes

In the previous lesson, we learned how to configure basic Static NAT to permanently map an internal address to a public IP so that external users can access it. That configuration allowed all ports to pass through to the inside host.

In this lesson, we take that concept further by applying port-specific static NAT so that only a single service — in this case, HTTP on TCP port 80 — is reachable from the internet. This provides more control over what is exposed while still giving outside users access to the intended service.


Scenario

  • Web Server: 192.168.1.100 should be reachable from the internet at 200.1.1.100 but only for HTTP.

  • Router:

    • Inside (LAN) interface: FastEthernet0/0 — 192.168.1.1/24

    • Outside (WAN) interface: FastEthernet0/1 — 200.1.1.1/24

Network Topology

[LAN]192.168.1.0/24 --- Fa0/0 [R1] Fa0/1 --- [ISP]200.1.1.0/24


Step 1 – Interface & NAT Role Setup

R1(config)# interface FastEthernet0/0
R1(config-if)# ip address 192.168.1.1 255.255.255.0
R1(config-if)# ip nat inside
R1(config-if)# exit

R1(config)# interface FastEthernet0/1
R1(config-if)# ip address 200.1.1.1 255.255.255.0
R1(config-if)# ip nat outside
R1(config-if)# exit

Marks the LAN-facing interface as ip nat inside and the WAN-facing interface as ip nat outside so the router knows which direction translations apply.


Step 2 – Static NAT for Web Server (Port-Specific)

R1(config)# ip nat inside source static tcp 192.168.1.100 80 200.1.1.100 80

Creates a one-to-one mapping for only TCP port 80 from 200.1.1.100 to 192.168.1.100. All other ports to this public IP are ignored by NAT.


Verification

1. Check NAT Translations

R1# show ip nat translations
Pro  Inside global      Inside local       Outside local      Outside global
tcp  200.1.1.100:80     192.168.1.100:80   ---                ---

Confirms the static NAT entry exists and is restricted to TCP port 80.

2. Check NAT Statistics

R1# show ip nat statistics

Total active translations: 1 (1 static, 0 dynamic)
Outside interfaces:
FastEthernet0/1
Inside interfaces:
FastEthernet0/0
Hits: 0  Misses: 0

Shows that NAT is active and currently tracking one static entry.


Common Mistakes

Mistake Symptom Solution
Forgetting to use protocol and port in static NAT All ports open to the server Use port-specific syntax
Incorrect NAT role assignment on interfaces NAT doesn’t work Verify ip nat inside and ip nat outside are correct
Using the router’s own public IP for static mapping Server unreachable Assign a separate public IP for the server

Side Note – FTP Server Example

If you wanted to allow full access to an internal FTP server:

R1(config)# ip nat inside source static 192.168.1.101 200.1.1.101

This maps all ports from 200.1.1.101 to 192.168.1.101. Use with caution, as all services on that host become accessible from the internet (just like the previous lesson). If you want just FTP access, restrict it to only the FTP service on port 21:

R1(config)# ip nat inside source static tcp 192.168.1.101 21 200.1.1.101 21

Real-World Consideration – Adding Access Control

You may have noticed that while this NAT configuration only translates port 80 for the web server, other traffic from the internet can still reach the router or other inside resources if NAT or routing allows it. This is because NAT is not a firewall — it simply translates addresses and ports.

In a real network, you would typically have a separate firewall device. In our scenario, we can simulate adding an inbound ACL on the outside interface to block all unwanted traffic. For example:

R1(config)# access-list 100 permit tcp any host 200.1.1.100 eq 80
R1(config)# access-list 100 deny ip any any
R1(config)# interface FastEthernet0/1
R1(config-if)# ip access-group 100 in

This allows only HTTP requests to the web server’s public IP and blocks all other inbound packets.
Refer to the previous ACL lesson to review extended ACL syntax and placement rules before applying this in the lab.


 User Challenge

The lab is available for download from this link. Try recreating the sample lab above using the provided IP addressing scheme.

  1. Modify the static NAT to allow only HTTPS (TCP port 443) instead of HTTP to the web server.

  2. If you added the FTP server, update the access-list to allow the service.

  3. Download the NAT3 and NAT4 troubleshooting scenarios and apply what you've learned.
    (requires version 2.12)

Static NAT with Service-Specific Mapping | PocketCLI

Download


>