In computer networking, a virtual LAN (VLAN) is a logical LAN that is implemented on top of a physical LAN. A VLAN allows multiple LANs to share the same physical infrastructure, thereby conserving bandwidth and reducing equipment costs. A VLAN trunk is a point-to-point link between two VLAN-aware devices, such as switches, that carry traffic for multiple VLANs. A VLAN trunk typically uses the IEEE 802.1Q protocol to encapsulate traffic for multiple VLANs on a single link. In order to configure a VLAN trunk on a Cisco switch, the following steps must be taken: 1. Enable trunking on the desired interface: interface fa0/1 switchport mode trunk 2. Configure the native VLAN for the trunk: interface fa0/1 switchport trunk native vlan 10 3. Configure the allowed VLANs for the trunk: interface fa0/1 switchport trunk allowed vlan 20,30 4. Save the configuration: write memory
To help you get started, we’ll cover configuring VLANs on Cisco switches. A switch’s access port can be configured in two ways: first, it must be configured in the VLAN database, and second, it must be assigned to a VLAN. Below, we’ll go over the following commands in detail to configure the topology. If you assign an access port to a VLAN, certain versions of Cisco switches automatically generate VLANs. In general, it is not a good idea to rely on this. Some switches will not work, while others will only report errors. VLAN0030, which is not very helpful, is used in VLAN 30 above.
A trunk port can be created by only one command, which is switchport mode trunk: set the port as a trunk port. A VLAN tag can be added to a switch using a variety of methods. When using a switchport trunk encapsulation command, you can use dot1q to encapsulating the trunk. To connect both switches on the same trunk, they must all have the same native VLAN. An Allowed VLAN list contains a list of VLANs that can be manually selected by the administrator. The trunk port to Router2 can also only be used for VLAN 20 and 30 traffic. Alternatively, you can delete individual VLANs from the list by using the remove keyword.
The show vlan brief command contains information about VLANs 1, 10, 20, and 30 in two sections. Each VLAN’s name and address can be found on the VLAN page. A VLAN other than these will receive traffic tagged with this VLAN tag, and that traffic will be discarded. When a VLAN is being displayed, the show vlan brief displays a list of access ports. The status column indicates whether a VLAN is active on the switch. There are two reasons why a VLAN may become inactive. The first step is to use the shutdown command when configuring a V LAN.
VLANs are those that exist in databases, but do not allow access to trunk ports or access to trunk ports. The show interfaces switchport command allows you to see information about the VLAN configuration of a switchport. This is simply an illustration of the lines that correspond to the articles in this section. The full output of this command can be found in a later article. Using the command, you can see a list of 26 pieces of information about each interface on your switch. The show spanning-tree command can be used to locate both trunk and access ports. This command allows you to see which switches are currently exited by a VLAN.
The L2 path can be traced over a network if you use these two commands at the same time. It is critical to remember the start points of each interface. Cisco created the Dynamic Trunking Protocol (DTP) in order to advance the concept of “plug and play” switches. When DTP is used, it determines whether a link will be designated as a trunk or access port. The other side of a link will be given too much power if you only control one side of it. If DTP automatically determines trunk status, it is frequently advised to manually configure a port as trunk or access. Unmodified interfaces have the following default DTP behavior: if the other side configures switchport mode dynamically, the link automatically becomes a trunk.
In other words, VLAN 1 is used for all switches in Cisco’s default configuration, ensuring that switch ports are not separated by L2. The switchport access command can be applied to a VLAN in the trunk port as well as the access port as part of a transition to an access port. A Cisco switch can configure VLANs as part of the CCNA exam. The purpose of this article is to describe the various configuration and verification commands that allow a switch to function normally or incorrectly. If you can create that topology in a lab or emulator, you will be relieved to know that you have mastered this aspect of VLAN configuration.