LAB: adding large strings of vlans


Original config with a string of allowed vlans that goes over a single line.  
! original config: 
conf t
interface GigabitEthernet0/22
 description test uplink 1
 switchport access vlan 3
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 2
 switchport trunk allowed vlan 3,100,101,150,250,350,500,550-555,800,902-904
 switchport trunk allowed vlan add 950
 switchport mode trunk
 logging event trunk-status
 carrier-delay msec 0
 no keepalive
 channel-group 3 mode active
end

If we want to add an additional set of vlans (in this case 801-803, we collect all the allowed vlans and put them into one string, and re-enter that: 
conf t
interface GigabitEthernet0/22
 switchport trunk allowed vlan 3,100,101,150,250,350,500,550-555,800-803,902-904,950
end

Then if we look at the interfaces new config, we see the additional vlans allowed over the interface: 
netlab-sw2#sh run int g0/22                                  
Building configuration...

Current configuration : 396 bytes
!
interface GigabitEthernet0/22
description test uplink 1
switchport access vlan 3
switchport trunk encapsulation dot1q
switchport trunk native vlan 2
switchport trunk allowed vlan 3,100,101,150,250,350,500,550-555,800-803
switchport trunk allowed vlan add 902-904,950
switchport mode trunk
logging event trunk-status
carrier-delay msec 0
no keepalive
channel-group 3 mode active
end

netlab-sw2#





Comments