0

I'm very new to Cisco networking. We had a Cisco engineer set up vlans on our network switches and then gave us instructions for moving our existing ports to the voice vlan he created.

I've moved about 10 so far, but it takes a while doing one at a time, even just editing the previous command. We have a project after the first of the year where it would be enormously helpful to be able to do multiple ports at once. I've seen lots of information on moving a range of ports - like interface 1/0/1-24, but we can't do all of them because we're only doing one department at a time, so the ports aren't linear like 1-24 but jump about - like 1,12,18,24,33 etc. I don't have the exact models of the switches - 48 port Ciscos is all I can say - if needed, I can drive to work and get them.

What I'm currently using to move a single port is: *

enable 
config t 
interface gigabit 1/0/nn – where nn is the port being moved 
switchport mode access 
switchport voice vlan 112 
auto qos voip trust 
spanning-tree portfast 
end 
write

* I've done some research and scoured Cisco documentation, but most relevant information pertains to single ports or a full range of ports, so it may not even be possible. I've tried doing a delimited list using different delimiters, but everything I've tried errors out. Should it be possible, can anyone show me what the proper syntax is for moving multiple, random ports on a Cisco switch?

Thanks in advance.

Ola Ström
  • 177
  • 1
  • 1
  • 6
43rdworld
  • 3
  • 1

1 Answers1

2
enable
conf t
int range gi1/0/1, gi1/0/12, gi/1/0/18, <etc>
<config>

However, if you're doing this over a period of time, you're probably better of scripting the configuration change using expect (or equivalent), which will ensure that the config change is made the same way every time. Cut-and-paste config is prone to oopsies.

womble
  • 96,255
  • 29
  • 175
  • 230