Everybody look to the next video.
So in this video we're going to be briefly talking about routers and gateways.
Now a router is a core component to a network.
This is the mastermind that that really does a lot of the routing.
I've talked about it which is sort of routing.
Now they they root in terms of do I know is it attached to me.
So is this host attached to me on a port if I'm the switch.
If I don't know what that is I send it upstream to my gateway which will go over in the next next few
slides but routers on the other hand have an idea of what switches or what destinations a packet needs
to go.
So for example if you have a router on your network it's configured to have entire network segments
or entire network ranges on a single one of its ports.
So if it knows that this packet is supposed to go into this particular network range if it fits in that
network range as its destination it'll just send it there and then all the switches will eventually
make its way it will get the packet to the destination.
Now it's also important understand that if it doesn't know the switch or the router doesn't know it'll
send it to its upstream gateway.
So in this case it might be the Internet service provider which will then make sure it gets to whatever
domain it's supposed to or IP address it's supposed to land at.
Now when you hit a when a packet hits a router it's also considered a hop switches won't show up in
your trace route which we'll talk about later.
However understand that the what you see in a trace route which shows every hop so every host that it
connects to you're going to see routers not switches you most likely have one of these at home if you're
watching this from home.
Now whether that's your phone acting as a router to handle the traffic or if you've got something like
Comcast or google fiber or anything at home or AT&T any of the home devices or ISP or Internet service
providers you most likely have something called a combination box which is a modem router and Wi-Fi
box all in one.
Some of you might have already replaced that with your own parts where you have your modem your own
router and your own switch which is fine.
And if that's the case you already know which which device I'm referring to now for everybody else it's
most likely that same box that has a combination of everything which will tape make sure that the traffic
on your machine reaches the internet or your machine reaches another machine on the same network.
Now as far as virtual box goes it has a internal router to itself to make sure when you talk to.
For example if you make your connection and that connection is that of a bridge connection you're going
to be connecting to.
I'm sorry you make a bridge connection in stead of in that you're connecting to the actual network which
mean you're gonna be using the router here.
However virtual box has its own router.
So when you talk to like when we set it up we set up a network where the two machines the two windows
machines can talk to each other that it set up a virtual router inside of there that they all had the
same Gateway which was the machine itself.
That was the router.
The next thing is is the routers have a heavy set of rules as well as the destinations like I mentioned.
Now the rules can can vary so some routers have built in Firewall some don't.
It entirely depends.
So in this case just think of the router as a set of rules that allows it to route traffic based on
certain parameters.
So if you want traffic from this network to go across the Internet for whatever reason you can do that.
So long as it's a not a private IP space.
Now if a router does not know where it's supposed to go and it has a gateway set up it will send it
to its upstream gateway.
Now this is important to understand that a network device most network devices have some sort of upstream
Gateway configured to them.
So it doesn't know where something goes.
It sends it to the next network device.
Eventually it'll land where it's supposed to.
Now a gateway.
We've talked about it a little bit.
Gateway is just the upstream network device of a network device.
So you can have a switch that's connected to a switch that's connected to a switch.
All three of those switches from the top going up have the one above it as a as a gateway and then the
very top switch or the tour of the top of rack switches connected to its gateway as the router.
Just as a common setup there so that's how you can understand what a gateway is or where someone's referring
to Gateway it's whatever the upstream device is where it's sending its where it's sending data
so a gateway is used when it doesn't know where the data's supposed to be.
And then in an example of this is our workstation or Windows machine.
When we looked at IP config as an example we saw gateway that in turn was referring to the local router
on that network which was our option gateway.
If Windows doesn't know where to send traffic it sends it everything to the Gateway in windows in Linux.
You can have multiple network devices but you can have one gateway per network device.
We'll get into that a little bit more when we start playing around with some of the windows in VM components
a little bit more.
But understand that you can have multiple network cards on a machine at once which will in turn give
you you can have multiple gateways and have it sent to different places depending on where the traffic
was being rude and in that case windows will do a little bit of routing to know does the destination
IP resolve in this network or not.
And then if it doesn't resolve in any it'll just send it to whatever the default has been set to.