RouteDuck

Switching and Cisco

VLAN Range Compressor and Expander

Paste VLAN IDs in any order, with or without ranges. You get the shortest form, the count, the expanded list and the commands.

Any order, with or without ranges, separated by commas, spaces or new lines. Lines from a running configuration work too.

Result

Compressed
10-13,20,30-32,45,100,200-201
VLANs
12
Ranges and single IDs
6
Lowest and highest
10 and 201
Trunk allowed list
switchport trunk allowed vlan 10-13,20,30-32,45,100,200-201
Create the VLANs
vlan 10-13,20,30-32,45,100,200-201
Expanded, comma separated
10,11,12,13,20,30,31,32,45,100,200,201
Expanded, one per line
10
11
12
13
20
30
31
32
45
100
200
201

The first trunk line replaces the allowed list on the interface. Use the VLAN comparator if you want to change an existing trunk.

How it works

The list is sorted, duplicates are dropped, and each run of consecutive IDs becomes a range. VLAN IDs from 1 to 4094 are accepted; 0 and 4095 are reserved by IEEE 802.1Q.

A long list is split over several lines, the first setting the list and the rest using add. A running configuration shows a long allowed list the same way.

Related tools