Static NAT translates a single private IP address to a fixed public or routable IP address, enabling consistent, one-to-one address mapping on a Cisco router. This topic covers configuration, verification, and removal of a static NAT entry using Cisco IOS commands.
Static NAT Configuration
We're going to program one of our routers with static network address translation. This is my network right here, and I'm going to be setting up NAT translation on router 3.
I have this switch hanging off of this network, and the IP address of this switch is 10.2.0.5. That's considered my inside local address. I want to translate it to an inside global address of 10.240.3.3. This network right here is 10.240.3.0/29, so I actually have up to eight IP addresses in here — of course one of those is the broadcast.
I'm going to be doing the translation on router 3, and it's going to translate the switch to this address, 10.240.3.3. I have a few IP addresses in here that I can use: this interface on router 2 takes up .1, this interface on router 3 takes up .2, and now I'm going to use another address of .3. So I'm using 10.240.3.3 on this 10.240.3.0 network. I'm using this because then I don't have to set up any extra routing — all these devices already know how to get to this network, and when I assign this IP address, this translation, to it, then this router will start responding to it.
So that's what I'm going to do: set up router 3. I'm going to jump onto router 3 here, and I'm going to start out by getting into the global configuration mode, and I'm going to configure the interfaces. The fa0/1 is the one that's attached to that switch, so I'm going to paste that into here, and that's the inside. Then I'm going to specify that serial 0/0/0 is the outside. I get a little n Bar there, and that's just because of insufficient memory on this device, but that's not going to hinder what we're doing right here.
The next one I'm going to do is this ip nat statement. Right now I'm pinging 10.240.3.3, and you can see that I'm getting a response that the time to live expired in transit, and I'm getting that back from 10.240.3.2, which is router 3. So it probably created some sort of loop there: the time to live decremented down, and router 3 then responded and said the time to live has died, so it kills the packet.
Once I paste this into here, we should then start getting a response, and the response is actually going to come from 10.2.0.5, which is that switch. So I'm going to put this command in here, and immediately we start translating it and we've got translation. We've got ping down here, we're pinging that IP address at 10.240.3.3, which is, once again, that NAT translation.
Next what I'm going to do is type in a few show commands so we can see what's going on. I'll end out of here and I'm going to show ip nat, hit enter, and we can see that 10.240.3.3 is going to 10.2.0.5. So this right here is our static entry, although it's created this ICMP packet that's being translated back and forth, and you can see that it's coming from 10.1.10.34, so it's coming from the laptop — that's the laptop IP address there.
Now I'm going to do a show ip nat statistics, and this one right here shows us some information on the translations. Peak translation is two; we saw both of those translations there. It's gone on 971 times — we probably do this again and it counted up 1,005 times, because I'm continuously pinging this, so that's why it's going to keep counting up.
The next command I'm going to do is clear out the stats here, so clear ip nat statistics would be something that I could use to clear those out, and then I can show them again, and you can see that it started over. So that's that clear statement right there. There's some show commands that we can use to see what's going on.
If I want to remove this, of course I just remove it with the no statement. So I'm going to get into conf t and then I'll just put a no at the beginning, copy that, paste it into here, and then it will kill that connection. Do I want to delete all the child entries? Yes, I want to delete it all — and now it's gone.
TechKnowSurge builds IT and cybersecurity professionals through hands-on, concept-first training built around real understanding — not memorization. Free interactive tools, structured programs, and 25+ years of real-world experience, all in one place.
Explore free tools and programs →