-1

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

Lauren.M
  • 1
  • 2

1 Answers1

0

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.

microchef
  • 89
  • 1
  • 11
  • The `add` keyword is not really doing anything because the default is to trunk all VLANs, and you are trying to add two VLANs to the list of all VLANs that already includes VLANs 20 and 30. To restrict it to only VLANs 20 and 30, use `switchport trunk allowed vlan 20,30` without the `add` keyword. – Ron Maupin Apr 06 '19 at 12:55