From the course: CompTIA Network+ (N10-009) Cert Prep
Static routes
From the course: CompTIA Network+ (N10-009) Cert Prep
Static routes
- If we're going to have routers, we have to have something built into the router that says, here's where you route data. And that boils down to something called a routing table. So every router on earth has a routing table. Now what's interesting is that not only does every router on earth have a routing table, but every computer on earth also has a routing, well, if it's on TCPIP network, has a routing table. So what we're going to talk about in this episode are the most basic types of routes that we put into routing tables, called static routes. A static route is a fixed route. Somebody goes into a routing table and types it in, and these things never change. These are the earliest type of routes used in routers. In other episodes, we'll take a look at stuff, called dynamic routes where the routers, themselves, can talk to each other, and if a connection breaks down between here and buffalo, it'll reroute itself. But in this case, we're talking about the most basic type of routes, static routes. So to help you with this, we're going to start by keeping it really simple and taking a look at an individual computer. In fact, we're going to look at this computer right here. What I want to do is show you, how I'm connected to the internet. So if we take a look at the magic whiteboard here, here is my network. It's a 192.168.4 network with a WAC 24 subnet. And this icon right here, that's 76, 192.168.4.76. And my gateway is 192.168.4.1. I'm not even going to worry about the other part of this. That's his problem. So now that you've got this basic idea, we'll talk about that other stuff in a minute. But once you've got this basic idea, let's go look at a basic routing table. You guys ready? Okay, so over here is my computer. And what we're going to do is, let's just start, keep it real simple and let's take a look at the routing table. There's a lot of different ways to do this. And I'm on a Windows system, so I'm going to type, route print. I want you to ignore all that IPV stuff for right now and stay right here. Let's read this routing table very, very carefully together. You ready? We start at the top. Do you see, it says where it's going to. You'll see where it says zeros? When we see zeros, that means we don't care. So I don't care where it's going to. I don't care what its subnet mask is. Send it out on my gateway, using my network card. Let's look at that together. I don't care where it's going. I don't care what its subnet is. Send it out on the gateway, using my network card. Got the idea? Now you'll say, "Well wait a minute, Mike. What if I want to talk to somebody on my network?" Well, here's a little trick when we talk about routing tables. When you talk about a routing table, always say at the end, say, unless, so watch this. I don't care where it's going. I don't care what its subnet is. Send it out on the gateway through my network card. We'll talk about metric in a moment. Unless I'm going to 127.0.0, with a net mask of 255, there is no gateway. That's what on link means. Don't go to a gateway, do this yourself, and send it out through your loop back. That right there is an example of loop back working. The reason loop back works is because there are a couple of settings, right here in the routing table that makes that happen. So in other episodes, when we do loop back, I say 127.0.0.1 is loop back. And then we say 127 dot, I don't care what the rest, and it still works, it's because of that right there. Here, let's read the second line together. If it starts with a 127, and I don't care what the next three numbers are, and if it starts with a 255 on the subnet and I don't care what the rest are, just send it to my loop back. Pretty cool, huh? And that works for all operating systems, by the way. So these next two lines are detailing that a little bit. In this case, it says, if it sends it to 127.0.0.1, exactly that, send it to 1.27.0.0.1. Seems redundant, doesn't it? It is. And what you're looking at here are conventions that aren't being changed in routing tables in 40 years. All right, so we now know that it's going to send all data out to the internet, even stuff that we want to keep in the network, unless, let's take a look at this fifth line together, unless it starts with 192.168.4, I don't care what the last value is, with a WAC 24 subnet. Do not send it out the gateway. Just send it out the nick. You got it? So this routing table right here is really the tool that allows even this individual host to determine, "Oh, this is something for Google. I'll shoot it out the gateway." Or, "Oh, this is a folder that I'm sharing on my buddy next door. So I'm just going to talk on 192.168.4." The rest of this stuff is a little dull, but I'm going to go ahead and mention 'em anyway. For example, if you're sending anything to yourself, 192.168.4.76, just go ahead and send it to yourself, is all that means. And this last one of any substantial interest here is 224. So 224 stands for multicast. Multicast is a very interesting tool that we use a lot, but don't really think of. So first of all, as a quick diversion when we talk about class full subnets, class A, class B, class C, anything that starts with 224 is a class D or a multicast. Interesting, huh? Anyway, what a multicast does is it, in essence, allows a computer to take on a second IP address that starts with a two two four. So let's say that there's 175,000 people who want to listen to somebody give a speech, okay? The video company that you just installed some app and you're just watching the video, but what they'll do is they will give those zillions of computers a temporary, unique 224 address that will only last for the duration of the video. And then by doing that, we can take one video and it'll disperse through the internet. All routers are designed to handle this, and we do that via what's called multicast, all right? So that's the basics of a routing table. Oh, by the way, you saw me type route print right there. Just so you know, let's put this down on the bottom of the screen, please. You can type this command, netstat space minus R, and it is the exact same command as typing route print. They're absolutely identical. Now that's interesting, but really, we're just looking at an individual host system. Let's dial it up a little bit and head back over to the whiteboard. So what I've got over on the whiteboard, I've added a little bit. What we're going to do is we're going to directly connect these two routers together, not through the internet. We're going to lease a T3 line and spend $5,000 a month to make a direct hookup between Houston and Dallas, Texas, whatever it might be. So what we do is we create another whole subnet. And in this case, I'm going to call it 17.18.19 WAC 24. There's only two computers on this subnet: the WAN side of one router and the WAN side of the other router. This number, it probably came from whoever's leasing me that T3 line, whoever it might be. So they just tell us what we're going to use there. Now what's cool here is that these, this isn't the internet, folks. Do you understand? This is a private routed, TCP IP network, or what we call an intranet. And what we're going to do is, I want a computer over here to be able to share folders to a computer over here. If this guy has a web server on it, I want this guy to be able to get to it. And with static routes, we can make that happen. So it becomes interesting is that the routers themselves have to have static routes. So what I did to help make this a little bit more clear is, I've actually set this guy's static route up to do exactly what we're looking at here. So basically, if we want anybody over here to talk to over here, that means this router has to send it out on, I'm sorry, 17.18.19.2, right? And it has to come over to 17.18.19.1. You get the idea? Now this router in here, he'll then have to send it down to the individual computers. I'm not worried about this part. I'm worried about this part right here. So you want to see it? I've got it all set up right over here. So what I've done is I've taken this little home router and I've got it configured, exactly like we just saw in the diagram. So on the LAN side, it's going to be 192.168.4. And on the WAN side, it's going to be 17.18.19. So let's take a look at this. All right, so we're looking right here. So you can see I set the WAN up as 17.18.19.2, and I set his gateway up as the other router. This always surprises people. When you think about a default gateway, you go, well, that's how computers get to their router is through my default gateway, right? Well, that's how routers get to the next router is through their default gateways. Routers have default gateways, just like anything else. And we can see down here on the LAN side, I've set it up as 192.168.4.1. Cool. So somewhere on here, we can find the routing table. Here it is. Okay, now look at this. This is great. So remember, we're in the router, now. We're not on an individual computer. So anything that's going to 17.18.19.1, the subnet mask is all 255s. Don't go out through the gateway, send it to the WAN. So what that's doing is that means if there was a 17.18.19.3 computer, 17.18.19.4, that route there would make sure it stays in that intermediary. That's not going to be used too much. It's the next ones that are a lot more interesting. Look at 192.168.4.0. Anything 192.168.4.0 with a WAC 24, don't send it out to the gateway. Send it out to the LAN and WAN. Oops, I made a little mistake there. I'll have to edit that. It says send it to the LAN and WAN, I'm going to turn it off. It should be just sent to the LAN. In this case, what we're talking about is anything for the 192.168.4 network, send it out to that 192.168.4 network through the land connection. But let's keep going. Next is anything for 17.18.19.0. Go ahead and send that out. No gateway, and send it out through the WAN. That makes sense. And then the last one, I'm going to skip this for right now 'cause that is a freak thing that this particular router does. But here's the most interesting one of all. This is the default route. That means I don't care what the IP address is, and I don't care what the subnet mask is, send everything over to the other system. Pretty cool, huh? So we have a default gateway, and notice that this reads completely opposite of the first one we saw where the default gateway was on the top. There's no official ruling on this, folks. So everybody has a different way to handle this. So what we've just done here is we've configured one router with static routes so that it can go ahead and make this entire network work. Static routes are great, but I want you to think about something before we leave static routes. What would happen if that connection between Dallas and Houston broke? Well, everything would stop. But couldn't we add another route? Couldn't we just pay extra money and have like two connections? You can do stuff like that. But what if one of these connections is really expensive, one of these is really cheap? What it begins to do is, it gets very complicated. And in today's universe, we use static routes a lot on little internal networks, but static routes are not at all common when it comes to getting out into the real world. And we've got lots and lots of episodes that talk about something very, very interesting, called dynamic routes.
Contents
-
-
-
-
-
-
-
-
-
Introduction to routers15m 4s
-
Network address translation (NAT)6m 10s
-
Implementing NAT2m 23s
-
Forwarding ports17m 26s
-
Tour of a SOHO router11m 48s
-
SOHO vs. enterprise8m 28s
-
Static routes12m 25s
-
Dynamic routing10m 22s
-
Open shortest path first (OSPF)3m 19s
-
Border gateway protocol (BGP)5m 25s
-
Enhanced interior gateway routing protocol (EIGRP)8m 10s
-
First hop redundancy protocol (FHRP)7m 56s
-
-
-
-
-
-
-
-
-
-
-
-
-