Why is this command not accepted?

switchport trunk allowed vlan add 52,160,176,177,247

I tried adding only one VLAN; it's also not accepted. No error is shown or anything; it's just not showing when I do show run int [interface id]. I have the following configuration. This will be used for an Access Point, just to allow certain VLANs on this port. What could I be missing or could this be an iOS bug?

Switch Model: WS-C3560-24PS
IOS Version: C3560 Software (C3560-IPBASEK9-M), Version 12.2(55)SE4, RELEASE SOFTWARE (fc1)
interface FastEthernet0/22
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 247
 switchport mode trunk
 spanning-tree portfast trunk
show int fa0/22 shows that allowed vlan are still showing "ALL".

Switch#sh int fa0/22 switchport
Name: Fa0/22
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: down
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: On
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 247 
Administrative Native VLAN tagging: enabled
Voice VLAN: none
Administrative private-vlan host-association: none
Administrative private-vlan mapping: none
Administrative private-vlan trunk native VLAN: none
Administrative private-vlan trunk Native VLAN tagging: enabled
Administrative private-vlan trunk encapsulation: dot1q
Administrative private-vlan trunk normal VLANs: none
Administrative private-vlan trunk associations: none
Administrative private-vlan trunk mappings: none
Operational private-vlan: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
  • Please use the Preformatted-text option ({}) rather than trying to format the text with HTML. – Ron Maupin Nov 1 '20 at 2:43

You have to already have a VLAN in the allowed list (not "all") before you can use the add command to append to the existing list.

So, first, use: switchport trunk allowed vlan 52

Then you can use: switchport trunk allowed vlan add 160,176,177,247

The reason being, right now it's set to "all", so there's nothing to add since they're all already allowed. That's why you have to limit it to just 1 or more (but not "all") vlan(s) at first and then add to it after the fact.

Alternatively, you can set the VLAN allowed list with multiple VLANs in a single command by simply not using the "add" keyword in what you were already attempting, such as: switchport trunk allowed vlan 52,160,176,177,247.

  • I do, those VLAN I'm adding are vlans that I already created or existing. Sh vlan br VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active 52 active 160 active 176 active 177 active 247 active – BehindTheWall Nov 1 '20 at 2:42
  • @BehindTheWall That's not what I was saying. I know you have the VLANs created on the switch. I'm saying you have to have your trunk port limited to a single VLAN before you can add more VLANs to its allowed list. Right now you have it set to allow "all" VLANs, so there's nothing to "add" (that's like saying infinity+1). – Jesse P. Nov 1 '20 at 2:48
  • 2
    @BehindTheWall, you are trying to add VLANs to a trunk that already has those VLANs in the list. If you remove the add keyword, then you simply set the allowed VLANs on the trunk to those in your command. You only use the add keyword to add VLANs to an already restricted list. The default list is all VLANs, so the add keyword does nothing. Leaving out the add keyword will simply restrict the trunk to those VLAN in the command. – Ron Maupin Nov 1 '20 at 2:52
  • 1
    Okay now it worked. I tried adding vlan 52 first on the allowed vlan. Then adding the rest of the vlan works as well. I know I tried adding vlan 52 last time which did not show at all. Anyways its working. Thank you! – BehindTheWall Nov 1 '20 at 2:54
  • 1
    I see that maybe what I did last time I added the command "add" instead of just "switchport trunk allowed vlan 52". thank you for clarifying that – BehindTheWall Nov 1 '20 at 2:58

Please add new vlan ids to existing vlans on trunk interface For example

#interface ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40
#switchport mode trunk
#no shutdown

For above senario for example if we want to add additional new vlan 60 to existing trunk interface then executive command

#int ethernet 1/20
#switchport trunk allowed vlan add 60
#no shut down

Then save configuration from running configure to startip config

#copy running-config startup-config

Then check again your config

#sh run 

It should be

#int ethernet 1/20
#switchport trunk allowed vlan 10,20,30,40,60
#switchport mode trunk
#no shutdown

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.