Can I config miultiple ports at once?

Unanswered Question
Aug 13th, 2003
User Badges:

Hello all,

hopefully there is a simple answer to this question...

I am setting up numerous switches and want to know if i can specify commands to multiple ports at once or do i have to enter commands for each port seperately? I am basically trying to disable STP on the ports and I want to disable ports 1-24 in a couple of commands instead of having to go into every port and issue the commands. Can this be done ?



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
deilert Wed, 08/13/2003 - 03:44
User Badges:
  • Silver, 250 points or more

On Cat IOS the command is set port dis 1-24

on an ios based switch you can use the interface range command

interface range fastethernet 5/4 - 5

konigl Wed, 08/13/2003 - 04:03
User Badges:
  • Gold, 750 points or more

And if neither of the above commands works for you, you can always do the script approach.

First, capture a copy of the startup or running configuration to a text file, then edit out the command lines you don't need to run again but keep the "interface" commands. Next, enter the command you want to execute under the first "interface" command, and copy it under each of the following "interfaces" where you also want to apply it. Finally, save the text file to a specific name, so you'll be able to run it again and again in the future.

Once you have the script prepared, get a console or telnet session running on the switch, and enter config mode. If using Windows HyperTerminal for a serial console connection, use Transfer, Send Text File... to get your script into the switch. If using Telnet, copy the script from your text editor and paste it into the switch. Exit config mode, save, review the switch configuration to make sure it looks like what you want it to; then move on to the next switch. Repeat procedure using your script over and over, until done with all your switches.

Some switch GUIs let you perform certain operations across multiple ports. From what I've seen on Cisco's, though, it seems like all they really do is perform the same one-interface-at-a-time configuration behind the scenes that I'm talking about here.

One catch to doing this is, sometimes you feed the script commands into the switch faster than the switch can take them, especially if the command is one which requires a little time to process on the switch. If you're on a serial console connection, you can adjust the time interval between issuing the command lines from the script. In HyperTerminal, go into Properties, Settings, ASCII Setup... and enter a Line delay of 1000 or 500 milliseconds. (That's one or two commands per second.) Leave Character delay at 0 seconds. If you have lots of switches to do, and you're comfortable that 500ms is too much time between commands, you can reduce it to whatever number works for you; I generally don't go any faster than 200ms (five commands per second).

Hope this helps.

drumrb0y Thu, 08/14/2003 - 12:29
User Badges:

I agree with the script edit and cut/paste approach. We keep text file copies of all of our 48-port 3500XL switches and whenever we need to set up a new one, we go into config mode and do a huge copy/paste procedure using the entire text file copy of the switch to be duplicated. Any tweaks (IP address, name and other unique identifiers) can be done manually and then the new copy saved as a new text file. It beats manually configuring 48 ports at a time over several devices.

rjackson Thu, 08/14/2003 - 13:13
User Badges:
  • Bronze, 100 points or more

If you are trying to disable spanning tree enter the global command "no spanning-tree vlan #"


This Discussion