-
How's it going everybody? in this video,
-
I'm going to show you what a trunk link
-
is on network switches. So a trunk link
-
is a connection
-
between two network devices,
-
whether they're switches or routers,
-
that's carrying tag traffic,
-
and I'll explain this. So the
-
only connection that I have set up
-
already that I'm not going to show you
-
is the trunk link that I have going to
-
the router. These two switches are going
-
to have two VLANs on them each. They're
-
going to have VLAN 10 and VLAN 20. And I
-
want to illustrate how these trunks are
-
typically used in the industry, so we're
-
going to go back to a scenario that I
-
introduced in the last lesson, Bob's
-
Grocery Store. So Bob's Grocery Store got
-
a network upgrade. They got new racks
-
installed, they got some newerish
-
network equipment, Cisco.
-
And they want to extend the back office
-
network to the upstairs as well. You know,
-
that Bob's Grocery Store is doing pretty
-
good. It's one of those double decker
-
grocery stores, and there's a back office
-
on the downstairs for people to, you know,
-
keep up with inventory, and there's a
-
back office on the upstairs for people
-
to keep up with in inventory and all
-
those other administrative tasks.
-
So the first floor switch is right here.
-
The second floor switch is
-
right here. So we're just going to, you
-
know, pretend that this switch is in
-
another floor
-
mounted to another rack
-
where this switch is going to be on
-
its own rack with its own set of
-
equipment. Usually in the industry, that's
-
how it's working. Now, we want to use the
-
same VLAN, VLAN 10, for the back office
-
network. So VLAN 10 and 20 have already
-
been created on both these switches. So
-
in the industry, if you're going to try
-
to extend the same VLAN across multiple
-
switches, no matter what floor they're on,
-
you need to have VLANS configured, but
-
the thing that I'm going to specifically
-
show you how to set up today is the
-
trunk. So what we have to do first and
-
this is what I recommend when you're
-
setting up VLANS, when you're setting up
-
trunking, any of that, is first, you
-
know, you get your plan, your diagram, you
-
know, as they say, proper planning
-
prevents poor performance.
-
Plan before, have your
-
diagram, know where you're connecting. So
-
the first thing we're going to do is
-
layer one. We're going to make our
-
physical connections. We've already got
-
one to the router. Now I want you to
-
help me in the comments.
-
If I am using gigabit 02, and
-
I want that to be the trunk between my
-
floors so that switch one and switch two
-
can communicate with each other, where
-
would I connect?
-
I'll show you now, but I want
-
you to challenge yourself so to
-
try to think of this on your own.
-
So I'm going to plug in right here,
-
this is gigabit 02,
-
and you always want your trunks to be
-
the fastest connection on the network. So
-
this isn't even that fast compared to
-
some of the fiber connections that exist
-
out there. Open up a tab, and Google
-
like fiber connections on switches,
-
you'll see like 10 gigs and more, the
-
speed. So we're going to connect between
-
the switches. You'll notice those
-
connections are coming up right away.
-
That's 'cus switches are normally
-
plug and play, where routers you got to
-
turn the ports on.
-
But we don't have a trunk configured
-
yet. So that's where I'm going to show
-
you
-
how to configure the trunks, but first,
-
let's connect our PCs. So I've got my
-
laptop over here, you can see the top of
-
it. I've got it over here. This is going
-
to be on floor two. So this is one of the
-
back office computers on floor two. But
-
we want it to be in VLAN 10. VLAN 10 is
-
taking up ports 1 through 12. So I'm
-
going to plug that in
-
And in real life, this might be for
-
the employees
-
workstations, could be for Voice over IP
-
phones, all the things in their office, right?
-
The same is true for floor- so
-
floor two, we got going. Floor one, so we
-
got some people down on floor one,
-
they're going to need their connections.
-
We're just using one laptop at this time
-
to test, but, you know, you always
-
want to test with at least two devices,
-
and then once those work, then you move
-
into deploying the larger groups of
-
hosts. So on this case, I'm going to
-
connect floor one,
-
which I've also happened to
-
configure VLAN 10 on, and it has ports
-
one through
-
10 in VLAN- I'm sorry, 1 through 12 on
-
VLAN 10 as well. So we're going to see
-
that come up, that should come up as well.
-
We see the light turning on, and it's up.
-
Now we're going to move over to
-
this.
-
We're going to go into floor two
-
switch first, and we're going to
-
configure the trunk. So I'll see you over there.
-
Okay, so now we're on our
-
host, we're configuring the switch, and we
-
want to get this switch with a trunk
-
link going to this switch. And in order
-
to do that as we did earlier, as we talked
-
about a few minutes ago or seconds ago,
-
I made a connection from
-
this switch on gigabit ethernet 02 to
-
gigabit ethernet 02 on the other switch.
-
So I'm going to connect a console cable
-
'cus I don't have SSH set up. I will show
-
you how to set up SSH and make it much
-
easier than what I'm doing now in a
-
future video. But for now, let me just
-
connect this.
-
I made the connection,
-
and now we are on the second
-
floor switch.
-
And the second floor switch
-
is going to be where we're going to
-
configure that trunk. So I'm going into
-
global configuration mode, and then I'm
-
going to go to int g02.
-
And I'm going to type this
-
command, as simple as that, switch port
-
mode trunk, enter. We're putting that
-
that port into trunking mode.
-
It went down and came back
-
up again, as we saw by the logs. And then
-
we're going to explicitly define which
-
trunks, or I'm sorry, we're going to
-
explicitly define which VLANs are going to
-
be allowed across the trunk link. When I
-
think of trunks, I think of them as like
-
toll bridges, and you're only allowed if
-
your VLANs tag is on the list, right? So I'm
-
going to do switch port trunk allow VLAN
-
10 comma 20. We only want those two
-
across. Now this could be a good form of
-
layer 2 segmentation at this point, where
-
if you believe that there's a VLAN that
-
doesn't need to connect to a certain
-
switch or get to a certain segment of
-
your network, you can actually exclude it
-
from that allow list, and traffic won't
-
even be trunked across the link. So I'm
-
going to type exit, and I'm going to do a
-
command, remember, as I have been
-
reminding y'all, configure and confirm.
-
Always make sure as you go. So I'm going
-
to do show int trunk.
-
And yep, there we go, we got our
-
trunks. And it looks like our VLANs 10
-
and 20 are allowed across that trunk,
-
cool.
-
Now what I'm going to do is I'm going to
-
move to
-
this switch right here, floor one. So
-
I'm going to go back here, grab this
-
console cable, move it to the other switch.
-
And in real life, this might mean
-
I'm connecting to an access server that
-
already has console connections into it.
-
And you can Google what an access server is.
-
Also, if I didn't have
-
an access server, I would be
-
walking back down to that switch and
-
actually making that connection with my
-
laptop. So, you know, when we talk about SSH,
-
if you don't already know what it is,
-
you'll see why it's so important that,
-
you know, you set that up on switches so
-
that you can remotely connect to them
-
from wherever you're at. But
-
let's continue with this. Now I'm on the
-
first floor, you should see it change
-
switch dash first floor. The naming
-
conventions of switches, in my opinion,
-
you should have somewhere in
-
there an indicator of where they are
-
in your organization and building, and
-
where they are on the rack. 'Cus as you
-
can see, this network sandwich right here,
-
it's got a bunch of stuff, you know, a
-
bunch of equipment stacked. So it can
-
be hard to know what's what, especially
-
if you don't have labels on them. But if
-
you have a good naming convention and
-
labels, it can really make it easier to
-
find devices, especially in the heat of a
-
moment where all you know
-
what is breaking loose, and you need
-
to troubleshoot things quickly. So we're
-
going into
-
global config mode. I made sure to
-
connect to gig 02 on this switch as well.
-
But you're going to have to pay careful
-
attention to that in the real world is
-
what connections are going where. And
-
then g02, I'm going to do basically the
-
same commands I just did. Switchport mode
-
trunk and switch port trunk allow VLAN
-
10 comma 20.
-
And I'm going to exit and do show int
-
trunk. And we're going to see- yep, it's
-
trunking VLAN 10 and 20. How do I know
-
that this is working? One thing I haven't
-
shown in this video is I set up DHCP
-
on this router beforehand, and I trunk to
-
the router. In the next video, I'm
-
going to show you what I did on this
-
router, but for now, just know DHCP is on
-
this router, there's a trunk link from
-
this switch going here so that DHCP can
-
reach both VLANs. So if my connections
-
are all right and my configurations are
-
all right, this PC should receive an IP
-
address on the 19216810 network. And
-
that MAC, so the PC on the first
-
floor, should receive an IP address from
-
19216810 as well, because in this
-
particular scenario, we're testing if,
-
remember, two different devices on
-
different floors can be connected to the
-
same VLAN
-
using trunking, so we should get
-
those same IP. So I'm going to test this
-
on my Windows system by doing CMD,
-
opening that up. I'll make sure you can
-
see it, ipconfig, let's see. We don't have
-
one, we're getting an APIPA. Remember what
-
the APIPA does? APIPA is a self-assigned
-
IP address or automatic private IP
-
addressing, and it essentially tells us
-
our computer did not get an IP address
-
from DHCP so we need to troubleshoot. In
-
this case, I know that I just need to go
-
ahead and do a renew 'cus I did a
-
release before I started the video. So
-
I'm going to do renew, and we're going to
-
wait on that.
-
It should be doing the DORA process.
-
It's going to request the IP address
-
from another machine.
-
Let's see.
-
Or from the server on the network.
-
Sorry, my trackpad's acting crazy.
-
And it looks like we did receive
-
one, how do I know? I got a 10.3
-
address. So what I'm going to do is now
-
move on over to the MAC, and we're
-
going to make sure that we get a 19216810
-
address over on the MAC as well,
-
which means we got to walk down some
-
stairs. All right, so now I'm back
-
downstairs, I'm on floor one switch,
-
we've got the trunk configured as I
-
showed. And now we just want to make sure
-
that we're actually in VLAN 10, and I'm
-
going to do that by going into the
-
network settings on the MAC.
-
And we're going to go and check and
-
make sure. Yeah, so right there you see
-
using DHCP. I always like to go manual,
-
basically release,
-
renew, and just make sure it works.
-
So that's basically requesting
-
another one, and I got dot two. And we
-
have successfully set up
-
a basic trunk link between two
-
switches that allow us to be on two
-
machines to be on the same network, but
-
they're not on the same switch. They're
-
in the same VLAN, but they're not on the
-
same switch. And just as a recap of how
-
everything's connected,
-
I'll grab yall, come over here
-
and check this out.
-
You know, you've got what I
-
didn't show is the configuration of the
-
router, that'll be in the next video. But
-
just so you know, g00 is going to g01, that
-
this g01 on floor 2 switch is a trunk.
-
And then g02 is a trunk going to floor
-
one on g02. I actually did it on g02
-
as well 'cus g01 is going to the router, so
-
g02 trunk to g02 allowing VLANs 10 and 20.
-
And I've got my laptop, which you see
-
the light has come turned off since I
-
closed the laptop, but, you know, port 1
-
through 12 are in VLAN 10 on here.
-
Ports 1 through 12 are on VLAN 10 up here. So
-
this trunk is is essentially like a toll
-
bridge allowing VLANs 10 and 20. Now, if I
-
tried to have a VLAN 30, and I didn't
-
allow it across this trunk, and I had a
-
30 down here too, we wouldn't have
-
connection between those devices.
-
So that is trunking, just the basics of
-
it. I'm looking forward to seeing you in
-
the next video, and don't forget to keep
-
learning.