cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
1112
Views
0
Helpful
2
Replies

XR / ASR9000, CLI: get list containing only physical interfaces

takao.nakamaru
Level 1
Level 1

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

 

1 Accepted Solution

Accepted Solutions

Klaudiusz Staniek
Cisco Employee
Cisco Employee

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

 

 

 

View solution in original post

2 Replies 2

Klaudiusz Staniek
Cisco Employee
Cisco Employee

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

 

 

 

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!