0

I am pretty new on the networking and cisco world. As far as I learned, tagging is just assigning a port to a vlan, and, as per definition, trunking is assigning a port to more than one vlan

I am trying to trunk a port on a couple of vlans and that is what's happening on a 350x-48P:

#configure terminal 
(config)#interface GigabitEthernet1/0/48
(config-if)#switchport mode trunk 
(config-if)#switchport trunk allowed vlan add 1,8
(config-if)#no shut
(config-if)#end

#show vlan 
Created by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN

Vlan       Name           Tagged Ports      UnTagged Ports      Created by    
---- ----------------- ------------------ ------------------ ---------------- 
 1                                      gi1/0/3-10,               DV        
                                          gi1/0/12-15,                        
                                          gi1/0/17-24,                        
                                          gi1/0/26-32,                        
                                          gi1/0/34-48,                        
                                          te1/0/2-3,                          
                                          gi2/0/1-48,                         
                                          te2/0/1-4,                          
                                          gi3/0/1-48,                         
                                          te3/0/1-4,                          
                                          gi4/0/1-48,                         
                                          te4/0/1-4,Po1-8                     
 2                        gi1/0/48                                S         
 3                        gi1/0/48                                S         
 5                         gi1/0/48                                S         
 6                         gi1/0/48                                S         
 7                         gi1/0/48                                S         
 8                         gi1/0/48                                S         
 10                        gi1/0/48                                S         
 40                        gi1/0/48                                S   

If I try only with a single port on a single vlan:

#configure terminal 
(config)#interface GigabitEthernet1/0/16
(config-if)#switchport mode trunk 
(config-if)#switchport trunk allowed vlan add 1
(config-if)#no shut
(config-if)#end

#show vlan 
Created by: D-Default, S-Static, G-GVRP, R-Radius Assigned VLAN, V-Voice VLAN

Vlan       Name           Tagged Ports      UnTagged Ports      Created by    
---- ----------------- ------------------ ------------------ ---------------- 
 1                                      gi1/0/3-10,               DV        
                                          gi1/0/12-15,                        
                                          gi1/0/17-24,                        
                                          gi1/0/26-32,                        
                                          gi1/0/34-48,                        
                                          te1/0/2-3,                          
                                          gi2/0/1-48,                         
                                          te2/0/1-4,                          
                                          gi3/0/1-48,                         
                                          te3/0/1-4,                          
                                          gi4/0/1-48,                         
                                          te4/0/1-4,Po1-8                     
 2                        gi1/0/16,gi1/0/48                                S         
 3                        gi1/0/16,gi1/0/48                                S         
 5                         gi1/0/16,gi1/0/48                                S         
 6                         gi1/0/16,gi1/0/48                                S         
 7                         gi1/0/16,gi1/0/48                                S         
 8                         gi1/0/16,gi1/0/48                                S         
 10                        gi1/0/16,gi1/0/48                                S         
 40                        gi1/0/16,gi1/0/48                                S   

Apparently it's just the right procedure, as per manual:

https://www.cisco.com/c/en/us/support/docs/smb/switches/cisco-small-business-300-series-managed-switches/smb4986-vlan-configuration-via-cli-on-300-500-series-managed-switche.html

Thanks for any help J.

jolek78
  • 1
  • 1
  • I do not see a problem. As far as adding VLANs to a trunk, it defaults to all VLANs, so adding them does not really do anything. – Ron Maupin Jan 16 '20 at 11:17

2 Answers2

0

There is a mistake in the manual. You can read the following: Note: In trunk mode, all VLANs are allowed by default. Using the switchport trunk allowed vlan add command lets you configure the VLANs allowed on the trunk.

When you trunk an interface all VLANs are allowed by default <- This is right. switchport trunk allowed vlan add command <- there is the mistake This command is used to add a vlan to the trunk, but the trunk allows all VLAN by default.

You have to use the same command without "add". (config-if)# switchport trunk allowed vlan 1,8 -> This command will allow only VLAN 1 and 8.

0

I don't see mistake on your side / command. It seems to me like you (or somebody else) have it added already before running this commands (adding it).

Try to remove the others or remove all and add just what you need. Be aware in case you are do configuration remotely to not remove VLAN which is used for the connection ;-).

VLAN 1 is default native VLAN and it is used also for e.g. spanning tree stuff. You will not be able to completely remove it but you don't need to use it for own traffic...

#configure terminal 
(config)#interface GigabitEthernet1/0/48
(config-if)#switchport trunk allowed vlan remove 2-7,9-40
(config-if)#end

It is good to check "starting state" before doing this kind of changes to not be surprise with the result.

Don't forgot to save the config to make it persistent over the reboot.

Kamil J
  • 1,632
  • 1
  • 5
  • 10