cancel
Showing results for 
Search instead for 
Did you mean: 

Show entire port configuration for a specific port

Show entire port configuration for a specific port

Mike_Rodriguez
New Contributor
I would like to have the entire configuration for a specific port > output in the same way you can view the entire configuration for a vlan with the pipe command.

as an example:
switch.name # show config | i V123
create vlan "V123-x_x" vr vr-xxx-xxx
configure vlan V123-x_x tag 123
configure vlan V123-x_x add ports 2:21, 4:7 tagged
configure vlan V123-x_x ipaddress 1.2.3.4 255.255.255.255
enable ipforwarding V123-x_x
enable bootprelay ipv4 V123-x_x
configure ospf add vlan V123-x_x area x.x.x.x passive
configure ospf vlan V123-x_x priority x
enable stpd S123-x_x auto-bind vlan V123-x_x
create vrrp vlan V123-x_x vrid x
configure vrrp vlan V123-x_x vrid x priority xxx
configure vrrp vlan V123-x_x vrid x preempt delay xx
configure vrrp vlan V123-x_x vrid 1 track-mode any
configure vrrp vlan V123-x_x vrid 1 accept-mode on
configure vrrp vlan V123-x_x vrid 1 add 1.2.3.4
enable vrrp vlan V123-x_x vrid x

!outputs the entire configuration for vlan 123

I would like to do the same thing for a specific port.
Some of the options to output the configuration for a port are:

sh port 1 information detail
show config | i 1 > where 1 is a port #. but 1 doesn't work because there are a lot of other instances where the # 1 is used in a configuration string.

you could do:
show config | i 45 > and the output is fine. but it won't work with the lower port #'s.

What i want output is all of the config and create commands that are applied to the port in question.

Ideally it would like it look something like this:

switch.name # show config | i Port 1 > but you can't do this because you cannot have a space between the word Port and 1. I have tried "Port 1" 'Port 1' Port-1 Port*1 and a few others. But none seem to work.

So... is there a way to have just the configuration commands output for a specific port doing something like this:

switch.name # show config | i Port 1
or
switch.name # show port config | i config

For some context, it would be the same thing in Cisco IOS when doing this:
switch#sh run int gi1/1
!outputs the configuration for int gi1/1

Any output (pun intended) would be Appreciated 🙂

Thanks,

~Mike



1 ACCEPTED SOLUTION

Michael_Andreas
Extreme Employee
i played a bit and figured out that :

show configuration | include "(port |ports |ports all|ports .-.])"
will show you icluding ( all) rages.

not sure if this is parcticable .

View solution in original post

9 REPLIES 9

Ludovico_Steven
Extreme Employee
I think this would require a new argument to "show configuration" CLI command on the switch, where you give it a list of port numbers.
The pipe include will never work here, because it does raw grep on the output and if the port is embedded in a range there can be nothing to match..

You could probably write a Python script to run on the XOS which would obtain the config file and then process it against a list of ports provided...

Or if it can help, this is what I get on my terminal:

Slot-1 Stack.9 #% cfg||1:15
alias% show configuration -b ||1:15
configure vr VR-Default delete ports 1:1-34,2:1-34
configure vr VR-Default add ports 1:1-34,2:1-34
configure vlan Default add ports 1:1-12,1:14-34,2:1-12,2:14-23,2:25-34 untagged
configure vlan test add ports 1:15 tagged
Slot-1 Stack.9 #%

...and on a standalone switch...

X440G2-12p-10G4.8 #% cfg||3
alias% show configuration -b ||3
configure vr VR-Default delete ports 1-16
configure vr VR-Default add ports 1-16
configure vlan Default add ports 1-6,9-16 untagged
X440G2-12p-10G4.9 #%

But the "advanced" grep capability is done here by the terminal (not the switch).
You are welcome to try it out; it's a home made terminal which I originally wrote for the Avaya switches (now acquired by Extreme) and I have recently extended to work on XOS.

http://www.oranda.fr/ACLI-terminal/
(this is of course not supported in any way by Extreme!)

Michael_Andreas
Extreme Employee
i played a bit and figured out that :

show configuration | include "(port |ports |ports all|ports .-.])"
will show you icluding ( all) rages.

not sure if this is parcticable .

Frank
Contributor
For the wildcard regex, may I suggest:
sh config | include " ports* 15$"that would mean "space followed by port, followed by 0(!) or more occurrences of 's', followed by space, then 15, then end-of-line"

But it does nothing to find config lines with "ports 13-19". If I find the time, I might fiddle with a script. I need to learn scripting on EXOS anyway.

Chad_Smith1
Extreme Employee
Unfortunately there isn't a simple/easy way to do this. With EXOS ports are usually added to other entities like VLAN, STP, EAPS, etc rather than adding the entities to the ports. As such, ports are referenced in many different forms throughout the different CLI commands. You could create a regex that would cover most situations, but it would likely contain some configuration commands that do not pertain to the port (because it matched on the number). Also, it will not catch commands that contain the port if the port is contained within a port list/range.

You could do this with a script, expanding the port ranges and accounting for the other outliers, but that may be more complicated than you were looking for.

There is some code in this script that could be repurposed to expand port ranges

This script changes port config from one port to another, so the functionality you are looking for i...

This would be a worthwhile feature request
GTM-P2G8KFN