Trunking for VLANs

368 Views Asked by At

What are the commands which are used to configure a port into a trunk (for VLANs 20 and 30)

I came up with 2 answers:

1) Switchport, Switchport trunk encapsulation dot1q, Switchport trunk allowed VLAN, Switchport trunk allowed VLAN add 20,30, Switchport mode trunk,

Or

2) Switchport, Switchport access VLAN 20,30, Shutdown

1

There are 1 best solutions below

1
On

The following could help:

Int Gi 0/1
Switchport trunk encapsulation dot1q
Switchport trunk allowed vlan add 20,30
Switchport mode trunk

If i want a native vlan, i.e not tagged. then:

Int Gi 0/1
Switchport trunk encapsulation dot1q
switchport trunk native vlan 20
Switchport trunk allowed vlan add 20,30
Switchport mode trunk

Switchport trunk encapsulation dot1q was dropped on newer switch's a while back, so depends on the model.

Switchport access tends to be used for devices that are not vlan aware.