- In this lesson, I'm going to talk about gateways, and in particular, default gateways. So what's a gateway? Okay, a gateway, as the word implies, is a way for traffic to leave one local network and be forwarded to other remote networks. So basically, think about the default gateway as the door out of the room. Okay, the room that I'm in right now, if I want to go out to the hallway, I'm going to have to exit through the door. When a computer wants to send a message off of its same local network, it needs to also exit its local network, and to go out and be forwarded to the actual destination. As we learned earlier, computers figure out whether or not a destination is on their same local network by going through a process of binary ANDing, which takes the subnet mask and ANDs it with the destination IP address to determine if the network portion of the address is exactly the same as the network portion of the sending host. So in the case of where that is not true, the computer has to actually send the packet to the gateway. We learned that every host on a network has to have, at the very minimum, an IP address and a subnet mask. Now, if that host intends on speaking to destinations that are not on its local network, it also has to be configured with the address of its default gateway. Usually in today's network, the default gateway configured on a device is the router interface that the traffic would come to first on its path to the internet. So basically, if we were to look at me, over here in the network management department, and if I was trying to reach a server that was out on the internet, my traffic would basically travel up through my switch and it would end up at the address assigned to the interface, router interface closest to me on the path to the internet. Now, if we go to a different host, say, for example, this one in the accounting department, and they were trying to reach the exact same server, their traffic would travel again through their switch, but they would enter the router at a different router interface. So the default gateway configured on hosts in the accounting department is different than my default gateway configured in my network management department. Once the host determines that the address of the destination is not on its same local network, what it does is it ARPs for the MAC address of the default gateway. Now, this is important to remember, because one of the problems that you find in networks frequently is because there's a mistake made, the default gateway address is not on the same local network. For example, if I accidentally configured this with 11 instead of one... My computer would not be able to send traffic using ARP to its default gateway address. So we have to be very careful when we are configuring network settings that we have the correct IP address, the correct subnet masks, so that my computer can accurately predict who is on its own local network and who is off the local network located on a remote network, and the default gateway address so that it knows what router to send traffic to in order to go off of its own local network.