cancel
Showing results for 
Search instead for 
Did you mean: 

Display port numbers discreetly in config and not in ranges

Display port numbers discreetly in config and not in ranges

simon_bingham
New Contributor II
My turn to ask a question
I’m mocking up a customer environment in our lab ( as I frequently do ).

Typically the hardware in the lab does not exactly match thecustomer environment thus I have to Change the port numbers to match lab gear

For example 3:4 might need to be 1

Search and replace might seem like an obvious solution except
I run into a problems were the ports numbers are described as ranges.

configure vlan NTVLAN add ports 3:1-4, 8:21-22, 8:45-46,9:45 tagged

does anyone know a way around this ? this is problem becausea customer may have 100s of vlans on many switches and I’m currently unable toautomate this process. If the config wasdisplayed with each port number discreetlyI could search and replace is there anyway to get it to display in this format?

6 REPLIES 6

Drew_C
Valued Contributor III
I've posted Oscar's script to GitHub. It works a bit differently than others there, in that it requires a webserver to run. It won't run directly on the switch.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/convert_port_config

simon_bingham
New Contributor II
thanks Oscar , I sort of suspected you might have something as you guys must

do this so much.

OscarK
Extreme Employee
I created for lab purposes just that what you want, take a customers config and change ports to match my switch I am using. It is written in python. I can send it to you, you only need to adjust it if you dont want to use a webserver to run it.

Drew_C
Valued Contributor III
I don't know how helpful it will be, but there's a Python script on our GitHub page that effectively does the opposite of this. It converts a non-stacking config into one that uses slot:port notation.
https://github.com/extremenetworks/ExtremeScripting/tree/master/EXOS/Python/non_stacking_config_conv...

It may give you some ideas on how to "undo" that with your own script to output a config section in the way you need them to be displayed.
GTM-P2G8KFN