Switchport Modes | Trunk Port | Access Port

Like this article! Share via

In this article, we will discuss switchport and switchport modes. While working on Cisco platform switches, you may come across Trunk Mode and Access Mode. So, let’s start!

switchport-mode-access-and-trunk

What is Switchport Mode in Cisco Switches

The term “Switchport” refers to a layer 2 switch interface, on which routing is disabled. So, you will be not able to assign an IP address to a switchport interface. Generally, switchport is used while configuring the VLANs on the Cisco Switch.

Note: All interfaces of a Layer 2 switch are “switchport”!

Different Types of Switchport – Access & Trunk

Switchport has two modes, i.e. Switchport mode trunk and switchport mode access. Let’s first understand the definition of both, Access Port and Trunk Ports.

Access Ports: Access Ports belong to a single VLAN and carry the traffic on a single VLAN only.

Trunk Ports: Trunk Ports, usually carry the traffic of multiple VLANs and by default will be the member of all VLANs configured on the switch.

To understand Switchports more clear, you can have a look on below image:

access-link-vs-trunk-link

Difference between Switchport Mode – Access and Trunk

In this session, we will discuss the difference between Trunk Port and Switch Port. The below table helps you with the differences between both of them.

Access PortTrunk Port
Access Port, is the member of single VLAN, and carry the traffic of that particular VLAN only.Trunk Port, carry the traffic of multiple VLANs. By default, Trunk ports member of all VLANs configured in the switch.
It is usually used to connect the end devices like Laptop, Printer, Computer, etc.It is usually used to establish the connectivity between Switch to Switch or Switch to Router (i.e. Router on a Stick)
Usually, less bandwidth is required while connecting the access port across devices.Trunk port usually required More bandwidth as compared to Access ports.
No VLAN tagging is performed, so no additional protocol required on Access Ports.For VLAN tagging, it used additional protocols depending on the environments. Two Protocols, i.e. IEEE 802.1Q or DTP (Cisco Proprietary)
Access Port Configuration:
GNS3_SW2(config-if)#switchport mode access
Trunk Port Configuration:
GNS3_SW2(config-if)#switchport mode trunk
Must Read :  OSPF Packet Types / Message Types and Neighborship Requirements

By default, Cisco switches configured as “dynamic desirable“. Dynamic Desirable configuration decides whether the interface will be in Access mode or Truck mode depending on neighbor device behaviors.

It is highly recommended to configure the switch port manually rather than dynamic desirable.

Configuration – Switchport Mode Access

In this session, we will discuss the configuration of the Access Mode of a switchport. As we already discussed, switchport used to connect with the End Points, i.e. Computer, Printer, Laptops, etc.

Note: You must need proper priviledgges to configure Swichport configuraiton!

The Below configuration will explain to you to configure the switchport of a CISCO IOS switch.

GNS3Network_SW2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
GNS3Network_SW2(config)# interface FastEthernet 0/1
GNS3Network_SW2(config-if)# switchport mode access
GNS3Network_SW2(config-if)# switchport access vlan 100
GNS3Network_SW2(config-if)#end
GNS3Network_SW2#

Another easy way to configure switchport is “switchport host”, which also configure the port as switchport. It will also configure STP portfast feature.

Note: Before configuring the switchport host, you need to sure that only Host is connected with switch.

GNS3Network_SW2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
GNS3Network_SW2(config)# interface FastEthernet 0/1
GNS3Network_SW2(config-if)# switchport host
GNS3Network_SW2(config-if)#switchport access vlan 100
GNS3Network_SW2(config-if)#end
GNS3Network_SW2#

Configuration – Switchport Mode Trunk

In this session, we will configure switchport as a trunk. As we previously discussed, a trunk port is used to carry multiple VLAN traffic.

Below is the trunk port configuration for Cisco IOS Switches:

GNS3Network_SW2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
GNS3Network_SW2(config)# interface FastEthernet 0/1
GNS3Network_SW2(config-if)#switchport mode trunk
GNS3Network_SW2(config-if)#end
GNS3Network_SW2#

By default, the trunk will be the member of all VLANs configured on the switch. So, it will carry out the traffic of each VLAN configured on the switch. You can restrict the switch to send the traffic of particular VLAN using the below command:

GNS3Network_SW2# configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
GNS3Network_SW2(config)# interface FastEthernet 0/1
GNS3Network_SW2(config-if)# switchport mode trunk
GNS3Network_SW2(config-if)# switchport trunk allow vlan 10-11
GNS3Network_SW2(config-if)#end
GNS3Network_SW2#

Related Articles

Must Read :  How to configure GRE Tunnel Between Palo Alto and Cisco Router

Reference

Summary

In this article, we discussed and configure Trunk ports and Access ports of a switchport. Access ports basically members of single VLAN and carry the traffic of single VLAN. On the other hand, Trunk port carries the traffic of multiple VLANs and by default the members of all configured VLANs. By default, Cisco Switches configured as dynamic desirable. It is highly recommended to configure the interface manually because it creates duplex and speed related issues.

Hope you like this article. Please share this article on social platfroms using below buttons to help us.

Like this article! Share via

Leave a Reply

Your email address will not be published. Required fields are marked *