Hands-On Lab: Configuring Static NAT

This hands-on lab configures static NAT to provide a consistent, permanent public IP address for an internal server, verifying inbound connections from the internet reach the server correctly through the translated address.

Static NAT ConfigurationInside Local and GlobalOne-to-One Translation

~3 دقیقه مطالعه · آخرین به‌روزرسانی ۱ مهر ۱۴۰۵

Lab Objective

Configure static NAT on a router to map a single internal server's private address to a dedicated public address, designate the inside and outside interfaces, and verify inbound traffic from an external host reaches the internal server correctly.

Lab Purpose

Static NAT, discussed earlier in this series, creates a permanent one-to-one mapping ideal for servers that need to be consistently reachable from the internet, such as a web server — unlike dynamic NAT or PAT, the same public address always maps to the same specific internal host.

Lab Topology

R1
  Gi0/0 (inside): 192.168.45.1/24
  Gi0/1 (outside): 203.0.113.10/30

Internal server: 192.168.45.100/24
Public address to map: 203.0.113.20

Task 1: Configure Basic Addressing

Configure both interfaces as shown.

Task 2: Designate Inside and Outside Interfaces

Mark Gi0/0 as the NAT inside interface and Gi0/1 as the NAT outside interface.

Task 3: Configure the Static NAT Mapping

Create a static NAT entry mapping the internal server's private address to the designated public address.

Task 4: Verify the Translation Table

Confirm the static mapping appears in the NAT translation table.

Task 5: Verify Inbound Connectivity

From an external host, connect to the public address and confirm it reaches the internal server.

Solution and Verification

R1(config)# interface gigabitethernet0/0
R1(config-if)# ip address 192.168.45.1 255.255.255.0
R1(config-if)# ip nat inside
R1(config-if)# no shutdown
R1(config-if)# exit
R1(config)# interface gigabitethernet0/1
R1(config-if)# ip address 203.0.113.10 255.255.255.252
R1(config-if)# ip nat outside
R1(config-if)# no shutdown

R1(config)# ip nat inside source static 192.168.45.100 203.0.113.20

R1# show ip nat translations

Pro  Inside global      Inside local        Outside local  Outside global
---  203.0.113.20       192.168.45.100      ---            ---
-- The static entry appears immediately and
-- permanently, unlike dynamic entries which
-- only appear once traffic actually flows

ExternalHost> curl http://203.0.113.20

-- Successfully reaches the internal server

R1# show ip nat translations

Pro  Inside global       Inside local         Outside local     Outside global
tcp  203.0.113.20:80     192.168.45.100:80    198.51.100.5:52341  198.51.100.5:52341
-- Once traffic actually flows, a more detailed
-- per-connection entry appears alongside the
-- permanent static mapping

Key Takeaway

A static NAT entry appears in the translation table immediately upon configuration and remains permanently, unlike dynamic NAT or PAT entries which only exist while active traffic uses them — this permanence is precisely what makes static NAT the correct choice for a server that must always be reachable at the same public address, regardless of whether traffic happens to be flowing at any given moment.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه