Configure trunk on Cisco switch

You need to configure trunk if you want to pass VLAN information across switching environment. Trunk is way to pass VLAN information from switch to switch across network. Tagging is second name for trunk, because frame is tagged with adequate information, VLAN ID. There is two methods: 802.1q standard which is used in multi vendor environment and where frame is tagged and ISL (Inter switch link) which is Cisco proprietary standard, where frame is extended. This standard is almost no longer used.

In this tutorial I will cover just basic configuration

On device where you have both standards implemented you have to select which one you will use and then enable trunk on port. Position on interface and type following commands.

SW1(config)#interface GigabitEthernet0/0
SW1(config-if)#switchport trunk encapsulation dot1q
SW1(config-if)#switchport mode trunk

Syntax switchport trunk encapsulation dot1q is disabled on switches with one standard enabled.

Now, do it on second switch and your trunk is functional, but it`s trunking for all VLANs. If you want limit number of VLANs you want to trunk, you will do it by explicitly allowing specific VLANs.

SW1(config-if)#switchport trunk allowed vlan 10

VLAN 10 will be allowed and no other. If you wish to add some VLAN to interface type following:

SW1(config-if)#switchport trunk allowed vlan add 20

You can use except to separate just one VLAN in order not to be allowed on trunk port.

SW1(config-if)#switchport trunk allowed vlan except 10

Remember, if add one VLAN and then in next row you add another one, previous row, thus VLAN will be overwritten.

You can verify your configuration with following command:

SW1#sh interfaces trunk

Port Mode Encapsulation Status Native vlan
Gi0/0 on 802.1q trunking 1

Port Vlans allowed on trunk
Gi0/0 1-4094

Port Vlans allowed and active in management domain
Gi0/0 1,10,20,30,100,200,300

Port Vlans in spanning tree forwarding state and not pruned
Gi0/0 1,20,30,100,200,300

That`s it, keep an eye on www.it-tutorials.net as we will continue with more tutorials . On our website you will find a lot of tips and tricks for any IT field !

 

Dejan Dzodan

Dejan Dzodan

IT professional for more then 15 years, mostly in financial institutions but with experience in ISP and retail. Proven in networking and overall infrastructure projects. Cisco instructor.

Leave a Reply

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


6 + 1 =