04-09-2018 02:13 PM - edited 03-01-2019 03:23 PM
Hello all
I have a question about the CLI capabilities in XR / ASR9000. We use our boxes for PEs with satellitesso it is common to have 1000s of subinterfaces.
Is there a CLI command that can help me get a list of all physical interfaces - with their descriptions (ommiting the subinterfaces?)
I would go for
# show interface Gig0/* description
....
Gi0/0/0/1 admin-down admin-down test
Gi0/0/0/2 admin-down admin-down test
Gi0/0/0/2.100 admin-down admin-down test
Gi0/0/0/2.101 admin-down admin-down test
....
but this produces a fairly long list because it includes all the subinterfaces. I usually use the extra utilities available in iosxr to parse the output of this command (e.g. egrep and filter out lines containing "\."
This it not the optimal way, I was wondering if there is a better way that I am overlooking to retrieve through CLI only the physical interfaces of an ASR9000
Solved! Go to Solution.
04-10-2018 05:24 AM
Hi Takao,
unfortunately there is no show interface command displaying only the physical interfaces (of course besides using | utility ....) however I could propose something else to consider. Maybe this will fit your requirements. You can try:
show operational Interfaces InterfaceDescriptionTable Filter InterfaceNodeAndTypeSetFilter/NodeName/Rack=0;Slot=0;Instance=CPU0/TypeSetName=HardwareInterfaces
This will produce the text output which can be parsed easily, or with xml option, you can get the same data in XML format.
<...> Interface/InterfaceName=TenGigE0/0/0/15 Interface: TenGigE0/0/0/15 State: IM_STATE_UP LineState: IM_STATE_UP Description: 9/5 Spirent <...>
The drawback is that you will need to repeat this command for each slot changing the slot number in the command.
Please let me know if it works for you.
Cheers,
Klaudiusz
04-10-2018 05:24 AM
Hi Takao,
unfortunately there is no show interface command displaying only the physical interfaces (of course besides using | utility ....) however I could propose something else to consider. Maybe this will fit your requirements. You can try:
show operational Interfaces InterfaceDescriptionTable Filter InterfaceNodeAndTypeSetFilter/NodeName/Rack=0;Slot=0;Instance=CPU0/TypeSetName=HardwareInterfaces
This will produce the text output which can be parsed easily, or with xml option, you can get the same data in XML format.
<...> Interface/InterfaceName=TenGigE0/0/0/15 Interface: TenGigE0/0/0/15 State: IM_STATE_UP LineState: IM_STATE_UP Description: 9/5 Spirent <...>
The drawback is that you will need to repeat this command for each slot changing the slot number in the command.
Please let me know if it works for you.
Cheers,
Klaudiusz
04-10-2018 01:25 PM
Hello Klaudiusz
I was not aware of this command, it gives access to a wide ranges of outputs, besides the available interfaces that I was trying to cover.
Thanks for the help!
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide