So what we're doing in this example is source address translation.
We're not going to do destination address translation as source address.
Translation tends to be the most common implementation of net, and that's what you need to know for
the CNA certification with source address translation, you're typically netting devices on your internal
network that use RFC 1918 addresses.
For those devices to access devices on the Internet, their addresses need to be translated or changed
from an RFC 1918 address to a publicly readable address.
In this example, the router has an IP address of 1.1, 1.1, and we're going to net host 10.1, 1.1
to an IP address of 1.1.1 or two.
So in this example, we not netting the PC's IP address to the Router's IP address.
I'll show you that example in a moment.
In this example, we are netting one internal IP address or private IP address to a dedicated public
IP address.
In this example, we've also got a server on the Internet with an IP address of 2.22222.
So the router will populate the net table as follows inside local addresses ten .1.1.1.
Inside global is 1.1. 1 to 2.
Outside local and outside global are set to 2.2.2.2.
In this example, we're not netting the outside address.
We are only netting the inside address.
If you were sniffing this local area network connection between the PC and the router using Wireshark,
and I'm going to demonstrate that in a moment.
What you would see is that the source address of the packet is set to 10.1.
Point one, point one.
That's the physical IP address of this host.
The destination address for traffic is 2.2 to 2.2.
In other words, the PC has initiated a session to the server and if you capture traffic on the local
network source addresses the PC's actual IP address and destination address is the server's IP address.
However, when the traffic hits the rudder, the router will look in the net table because it's receiving
traffic on an inside interface which you configure and the traffic is destined to an outside interface.
So you configure the router with the inside and outside interfaces.
And because of that configuration, the router looks in the net table to see if addresses should be
netted.
In this case, the source IP address matches an entry in the table.
So the source IP address is going to be changed to one point.
1.1 to the destination address is not going to be changed.
It's going to remain as 2.2.22.2.
The router will change the source address and then forward the traffic to the internet.
The source address matches the century of 10.1, point one, point one and the destination address matches
this entry to to 2.222.
So the router is going to change the source IP address to 1.1. 1 to 2 as per the inside global entry
in the net table.
In this example, the outside, local and outside global addresses are the same, so the router doesn't
change the destination address in the packet.
If you sniffed the traffic using Wireshark on this link from the router to the internet, you would
see that the source address is set now to 1.1. 1 to 2 rather than 10.1 1.1, which it was set to on
the inside network.
When the traffic arrives at the server and the server receives the traffic, the server believes that
it's talking with a host with an IP address of 1.1.122.
The server never sees that the actual source IP address was ten .1.1.1.
When the server replies, the source and destination addresses are swapped around.
So the source address is now 2.2 to 2.2 and the destination address is now 1.1.122.
The packet is now routed across the internet and arrives at the net router.
When the router receives the traffic, it sees that the traffic is destined to an IP address of 1.1.1
or two.
The router will check in its net table whether it has a matching entry.
In this case it does.
The inside global address is one point, 1.122, which matches the destination address.
So what the router will do is it will know that the IP address 1.1 and 1.2 and change it to ten .1.1.1
before forwarding the traffic onto the local network.
The source address of quadruple t is not changed because those entries are the same in the net table
for outside local and outside global.
So once again, if you sniffed the traffic between the router and the PC, you would see that the destination
address is 10.1.
1.1 source address is two, two, two, two, two, two, two.
And that's because the router has changed the destination IP address based on the inside local entry.
Now that's essentially how Nat works.
This is a simple 1 to 1 mapping with basic net.