i am planning to switch hsrp status from standby to active for around 100 vlan interfaces. The problem is that the group numbers are not matching the interface vlan number. for example there is int vlan1234 with standby group 99 - totally irrelevant numbers.

Is there any smart way to filter the output so i can use it in excel with some functions like append, concanternate etc and multiply it for all 100 interfaces?

All i need is to set the priority to 150 for all of them without entering one by one to the interfaces, but pasting a pre-prepared document.

Thank you for your time.

  • You could probably import it into excel using fixed column delimiters. Then you can extract the required info
    – Ron Trunk
    Aug 18, 2017 at 15:13
  • What would you like as output?
    – user36472
    Aug 18, 2017 at 16:14
  • Did any answer help you? If so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you can provide and accept your own answer.
    – Ron Maupin
    Oct 18, 2017 at 2:47

2 Answers 2


To rephrase ar_'s answer - please give the credits to him, if you are going to award them.

Copy the configuration section with the "interface vlan XXX" statements into a text file.

That will look somewhat like this

interface vlan 1028
 ip address nnn.nnn.nnn
 standby 98 ip <HSRP.IP>
 standby 98 prio 120
interface vlan 1092
 ip address nnn.nnn.nnn.nnn
 standby 96 ip <HSRP.IP>
 standby 96 prio 120

Then, start removing lines, until all is left is a text file with this content:

interface vlan 1028
 standby 98 prio 150
interface vlan 1092
 standby 96 prio 150
interface vlan 1056
 standby 140 prio 150

Log into the box and paste it.

If your terminal emulator has the feature, put a bit of a "line per second trottle" on it, like a 20ms delay per line - so no more than 50 lines/sec are entered.

cheers Marc


Why would you need filters to begin with? It is standby X priority P in Cisco IOS. Copy all the interface config into you favorite editor, and replace priority P with priority P'. Then just paste result into console. Make sure it is pasted properly using some technique. For instance you can simply paste not all 100 at once, but 10-20.

If you need to change priority for plenty of noncontiguous vlan interfaces, delete unnecessary ones manually or use regexp.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.