Port Address Translation (PAT) can be configured to translate all internal traffic to a single public IP address assigned to a router's external interface, which reflects how most real-world networks connect to an ISP. This demonstration walks through the full configuration and uses Wireshark to verify the address translation in action.
PAT to Specific Interface
Quite often on our networks we only have one IP address, a public IP address. We have some sort of external router or firewall that's given an IP address, and that's what we have to work with. Therefore we don't have a range of IP addresses that we can translate to, but we have one IP address, and that is the IP address of the interface that we have to do all of our translation to. Let's take a look at what that looks like when we do PAT to a specific interface.
This is my network right here. This time we're going to use router 2 to do the network address translation. What we're going to do is generate traffic from this switch right here through this router 2, which is going to be translated into another IP address, specifically the IP address of this interface on router 2, in which case then it will generate to this demo laptop. We're going to use Wireshark to confirm that we've changed the address.
Before we do this, let's go ahead and do a ping from this switch to the demo laptop and check out the IP address. I'm going to do a ping of that laptop, and we pull up Wireshark, and we can see here it came from 10.2.0.5. That makes sense, because that's the IP address of that switch.
Now let's get in there and do our NAT configuration. What I'm going to do is still specify the range of addresses that we're going to translate, so these are the local addresses. If I pull up this network diagram, that's all of the addresses right here in this network. I'm going to copy that, and I've got to get into the global configuration mode. I will create this access list one, in which I'm defining that network that we just covered right there.
Then I'm going to use this — this is the same ip nat inside source that we're used to. It's using list one, so this is the local addresses that it's going to be translating from, and it's going to translate to whatever interface s010 is going to be. It's going to be doing PAT, and we see that because of the overload statement.
Let's get this into our network here. I'm going to paste that into there. I'm going to of course have to define what the inside network is, so I'll define that, and what is the outside: s010 is going to be the outside, so I'll do that. It's that same error message we've been receiving, so that's expected.
Now let's go ahead and generate the traffic again. We'll generate traffic, and it should pop up here, and it's coming from 10.240.2.1. So the IP address did change, and it changed to this interface right here, which is s010 on router 2. We were successful; we are now using this interface.
This is a common setup, because once again, when you're connecting to your internet service provider, you may not have a range of addresses but are just given a single IP address, and so this is how a lot of places are set up.
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 →