NAT
NAT
What I have in front of me is a diagram of what a typical small network attach the
internet might look like.
Pretend I'm down here in Houston so we use Comcast a lot down here.
So this is some Comcast router and it has an IP address on its way inside that came
from Comcast.
Now inside we have a lot of computers and could be a wireless access point with
some smartphones or who knows.
So remember the rule of the internet says that all devices that get on the internet
must have a legitimate IP address.
And in order for you to appreciate the magic what I want to do is let's go back in
time to the early 1990s back when I first started getting on the Internet and let
you understand that it was a lot trickier back then to do that.
Sure.
We didn't have cable modem back then but I will say it a some kind of phone
connection and I would have this and I would have an IP address that came from my
ISP.
But remember the rule the Internet says that all devices must have legitimate IP
addresses.
So the other thing we'd have to do is call the ISP and go oh I need one two three
four or whatever number of IP addresses and you would also be sold an IP address
range just for your own little subnet your own little network ID that was yours and
yours alone and you'd have to go in and configure each one of the devices you'd
have to configure the landside of the router.
All for that network ID and that is in the bad days is how you got on the internet.
The IPV for standard only has four billion addresses and they're not used very
frugally so even by the 90s we were like holy cow we're in and out of IP
addresses.
So they invented this wonderful thing called Network Address Translation with
network address translation and this is built into routers every SOHO router out
there has Network Address Translation.
It's built in and you'd be hard pressed to find one that doesn't have it already
turned on and ready to work any way to appreciate.
Network Address Translation Let's pretend that oh this computer right here wants to
get over to Google.
All right.
This is the internal IP address for my device and this is the data.
Now when this goes out if I'm using a nattered router when the nattered router sees
this.
He'll look at this IP address and on our internal network so we use IP addresses
like 192 168 private IP addresses.
And these are not to be ever put out on the real Internet.
So what happens is the router automatically just plugs in his IP address on the way
inside which is a legitimate IP address.
He's going to check the ports and the IP address he's going to write all this down.
Put it into a table because when this comes back he needs to be able to know who to
send it back to.
So out it goes and be something like this right because it's coming back in now.
But then he's got to look at other information compare it to his table and go oh
that's really for that guy over there.
And now this is the internal IP address and it can get to that particular device.
So that's the beauty of that network address translation allows us to have lots of
devices that are on the internet without using legitimate IP addresses.
One of the big issues that we have with Nat is that somebody has to start a
conversation so that this guy knows who to send it back to.
And that's fine for people who are just using web browsers or checking your email
or stuff like that.
But what if these were like web servers or something like that.
Well that's where things become a little bit different in this case we have
different versions of Nat and these are on the network plus you need to be aware of
them.
Now static net simply means that I am going to assign one IP address so that
anybody who comes in on a particular IP address is always sent to this one
particular guy.
So static net is we use the term port 14 a lot when you hear this as well.
But the thing to remember with static Nat is that all incoming addresses for one
particular IP address go to one particular device.
So that's one way to do it the other way to do it and this is very rarely done but
it does exist out there is a dynamic that or this is also called your Eddy puled
Nat with dynamic that I got.
For devices that may or may not want to get out to the Internet.
So what I'll do is in order to save money I'll have say two IP addresses built into
this router.
And if one of these people wants to get out well he'll be given that IP address and
he can do whatever he wants to do.
I've got one IP address left so this guy wants to get out now he can go ahead and
use that.
The problem with dynamic Nat is that you have a fixed number of IP addresses.
Make sure you know the difference between static Nant regular net or or which we
would call Port address translation and dynamic debt you're going to see all three
on the exam.
PAT short for port address translation, a type of network address translation.
During PAT, each computer on LAN is translated to the same IP address, but with a
different port number assignment.
PAT Translates internal IP addresses to an internet address and tracks the packets
DNAT (Dynamic NAT) has a limited pool of internal addresses to give to a number of
internal devices
Implementing NAT
What I'm going to do right now is I'm going to take my laptop and I'm going to
connect to my home router and we're actually going to see how that can be
implemented in a home router scenario.
That's just how they are because they're gonna be used at home big serious routers
that are going to be used at an enterprise level.
They almost never have net turned on and you need somebody who knows how to do it.
So in this case we're going to start with a router that has net turned on and turn
it off and then turn it back on again.
So here we are in my little Linksys router it's an old lynxes 2500 great little
router.
And if you take a look you'll see that my way an IP address is 161 16 513 So that
came from my ISP.
And by the way this is a bogus address so don't bother pinging it now on the
landside you'll see that his IP address is 192 168 13:1 and he's also a C-p server
so he's passing out one to 168 13. 100 and incrementing up from there to all the
clients on the land side.
Now it's different for every one of these little routers and this one it's actually
very pretty.
You can see right here where it says Nat enabled disabled on other routers.
It'll say like Gateway enabled or disabled and you just have to know through
osmosis that that's what it means.
So if I want to disable it I'd click that hit save settings and it's disabled.
So one of the things that cracks me up about people is oh go well you know I just
got my new Comcast and we plugged in and everything started working.
Because other things were taking care of stuff for you Nat as well as other aspects
of today's modern networking.
Make all of this work pretty much invisible to the normal user.
SOHO (Small Office Home Office) routers ship with NAT enabled
NAT on a SOHO router can be disabled through the router's configuration page