So guys, let us start with the concept of VLANs.
So first, let us build the prerequisite knowledge to understand VLANs.
First of all, VLANs are implemented by a layer two device called L2 Switch.
So a simple so a simple layer two switch device is shown in the diagram.
You can see that switch has interfaces as shown.
Interfaces of L2 device are usually termed as ports in networking terminology.
So in the rest of this module we may use interfaces interchangeably with ports.
Switch is a L2 device.
It works only with Mac addresses, so therefore forget IP addresses, interfaces or ports of a switch
are not configured with IP addresses like layer three router interfaces are configured, Interfaces
of a switch can operate in one of the two modes that is access mode or trunk mode.
So you can see in this diagram the yellow interfaces actually denotes that these interfaces are working
in access mode, right?
Whereas the orange interfaces of L2 switch denotes that this interface is working in the trunk mode.
Right.
So each interface of a switch or each port of a switch either operate in access mode or in trunk mode.
It is the responsibility of the administrator to configure the interfaces of the switch to operate in
exactly one of the two modes.
So note that a given interface of a switch cannot operate in both the modes.
It has to operate only in one of the two modes, either in access mode or in trunk mode.
Now what exactly we mean by access mode or trunk mode that we will going to take a look shortly.
So it is the guidelines that access mode interfaces are connected to hosts, whereas trunk mode interfaces
are connected to Gateway L3 router or another L2 switch.
So we shall see how these guidelines are deployed in the network topology using L2 switches.
So you can see in this diagram we have two L2 switches.
Now, as per the guidelines in the last slide, you can see that the interfaces which connects the two
L2 switches should be trunk, right?
And the interface of an L2 switch, which is connected to Gateway L3 router is also trunk.
Right.
And the rest of the interfaces of L2 switches, which is connected to end hosts, are always access.
Right.
So Ethernet zero, Ethernet one Ethernet two interface of L2 switch one is configured to operate in
access mode.
Right.
Whereas Ethernet three of L2 switch one is configured to operate in trunk mode.
Similarly, Ethernet four and Ethernet one interface of L2 switch two is configured to operate in trunk
mode, whereas Interface Ethernet two and Ethernet three of L2 switch two is configured to operate in
access mode.
Right.
So it is a guideline that all the interfaces of L2 switch, which is connected directly to the end hosts,
are always configured to operate in access modes, right?
Whereas those interfaces of L2 switch, which is connected either to another L2 switch or to a gateway
L3 router, or always configured to operate in a trunk mode.
Now let us try to understand that how VLANs are configured on interfaces of L2 switches.
So you can see that VLANs have been configured in the following way on the interfaces of L2 switches.
So you can see that as per the guidelines, the access ports can be configured to operate in exactly
one Vlan, whereas trunk ports can be configured to operate in more than one VLANs.
Right.
So you can see in this diagram that any access port is configured to operate in exactly one Vlan.
So the interface Ethernet zero, Ethernet one Ethernet, two of L2 switch one is configured to operate
in Vlan ten and Vlan 11, whereas you can see that the interface Ethernet three of L2 switch one is
configured to operate in three VLANs that is Vlan ten, Vlan 11 and Vlan 12.
Similarly, interface Ethernet four of l2 switch two is configured to operate in three VLANs that is
Vlan ten, Vlan 11 and Vlan 12.
Right.
Whereas the rest of the access ports or access interfaces of L2 switch two is configured to operate
in exactly one Vlan.
So ethernet two interface of l2 switch two is configured to operate in Vlan 12.
Right.
And similarly, Ethernet three interface of L2 switch two is configured to operate in Vlan 12 and the
interface Ethernet one of L2 switch two is configured to operate in three VLANs because interface Ethernet
one is configured to operate in a trunk mode.
So always remember that when the interface is operating in access mode, the interface could be a part
of exactly one Vlan, whereas if the interface of an L2 switch is configured to operate in trunk mode,
then that particular interface could be configured to operate in more than one Vlan.
Right.
So this is how access and trunk ports can be configured.
Now we will see that what is the use of access and trunk ports and what are they used for and what is
the concept behind configuring a port of an L2 switch as access and trunk?