VLANs - Access and Trunk Links

First, of all VLANs, "VLAN" stands for Virtual Local Area Network.
It's used to logically separate hosts residing in the same physical network or in the same address space.
How do you do that?
Well, you configure switchports on a L2 device to which you connect end devices accordingly.

In this picture we've got: three switches, five computers, and two VLANs.
For those who may not differentiate the colors, PCs 1, 3 and 5 belong to VLAN 10 and PCs 2 and 4 belong to VLAN 20.
As I've already mentioned, VLAN membership is configured on a switch.
How do we do that?
Well, we configure the interfaces on switches - these interfaces that will have endpoints, whether they're
computers or servers connected to them. So these interfaces will be configured to belong to a specific VLAN, and to do that, the interface must first be in "access" mode.


Let me show you the commands and then I'll clarify.
Fast Ethernet 0/1 is this interface. You can see the label "F0/1" on PC 1 and PC 1 should be in VLAN 10.
So we will put interface Fast Ethernet 0/1 into, first, access mode and then into VLAN 10.


One thing you need to remember here is that access links can only carry one VLAN. So F0/1 will only carry VLAN 10. F0/2 will be joined to VLAN 20, so it will only carry VLAN 20 etc..
 

Next logical question is: what about this link over here, in between the switches?
Well that is what trunk is for.


So simply put, unlike access, trunk links can carry several VLANs.
Actually, a switch will process any VLAN, as long as that VLAN exists on that switch.
You don't have to manually create VLANs on a switch though - once you issue this command, you'll get an informational message saying "VLAN X is now created", on this particular switch. And once you became all advanced and have many VLANs in your network, it will makes sense to use a protocol which will dynamically teach - so to say - all of your switches of all of the VLANs that exist in your network. 

Just to mention here,

I made this explanation a bit more trivial just so you could understand the big picture, and I will cover the actual details once we finish the exercise.
 

Now that we have covered the basics let's go to our example.

For each of the examples we'll go through, guide will be available to you, with all of the commands necessary to finish the exercise. For this one we'll need to do five following things:

1. Configure host names according to the diagram and a banner on Switch 1 with your name.
2. Access interfaces and VLANs.

This means: Configure access interfaces and VLANs, and then configure trunk interfaces. Configure IP addresses on PCs, and then number five:

Configuration of Access and Trunk Interface

Create a VLAN:
Switch(config)# vlan X

Configure Access:
Switch(config)# interface FastEthernet 0/1
Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan X

Configure Access/Trunk:
Switch(config)# interface FastEthernet 0/2
Switch(config-if)# switchport mode trunk

Answer the question why can't PC2 ping PC4, and fix the issue.
So by the time we complete the first four tasks, PC2 won't be able to ping PC4, and I'll explain why when we get there. Of course, I will share answer in this post.

Hasnain Zaidi

Hey Folks! Welcome to my blog. Stay tuned as we will be discussing the Installation, Configuration and Troubleshooting of Systems, Networks, Cloud Integration and Bunch of other Tech Stuff.

إرسال تعليق (0)
أحدث أقدم