There are times when we are required to configure NAT Static outside feature on cisco devices.
Below scenario will help in understanding the requirement of “ip nat outside source static” command.
An existing customer has office location “Site A” which accesses Internet and business applications through the Gateway Router R1 (192.168.123.1). H1 and H2 are hosts which need to access a remote Server (IP = 100.100.100.1) via Gateway Router R1. Default Route is enough for these end systems to reach outside network through default Gateway.
This is where NAT command reference of “IP nat outside source static” comes to play.
Let’s see approach of how H1 and H2 users can access both Servers without performing much change in network.
Basic config on R1, H1 ,H2 and R2 Devices –
Note – Routers are configured as hosts for testing purpose –
Now it’s time to configure R2 and perform NAT such that both the remote Servers S1 and S2 may be reachable. The approach will be to change the IP address of S2 Server from 100.100.100.1 to 192.168.123.4 with help of NAT on R2 where Hosts H1 and H2 will think they are communicating with Server S2 (IP address NATted to 192.168.123.4) on LAN Subnet.
This is how R2 outside NAT configuration will look like –
Note – keyword here is “add-route” along with nat outside static command. “add-route” will include route for destination 192.168.123.4 towards WAN Side i.e. pointing towards real S2 IP.
The configuration is substantiated by below command –
Let’s ping Servers from H1 and H2 (For H1 and H2 the Server IPs will be S1 =100.100.100.1 and S2 = 192.168.123.4)
Let’s view the NAT translation on R2 for s=100.100.100.1->192.168.123.4 translation Hence , through “IP Nat Outside Source Static” command overlapping IP address problem has been resolved and end systems H1 and H2 are able to simultaneously access both the Servers.
Related- Static vs Dynamic NAT- NAT Types
ABOUT THE AUTHOR
I am here to share my knowledge and experience in the field of networking with the goal being – “The more you share, the more you learn.”
I am a biotechnologist by qualification and a Network Enthusiast by interest. I developed interest in networking being in the company of a passionate Network Professional, my husband.
I am a strong believer of the fact that “learning is a constant process of discovering yourself.”
– Rashmi Bhardwaj (Author/Editor)