Quick tip: display interface bandwidth

To display bandwidths of all interfaces configured on the router use show interface | include protocol|BW command.

Here is a sample printout:

Rtr#show interface | include protocol|BW
FastEthernet0/0 is administratively down, line protocol is down
  MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec,
Serial1/0 is up, line protocol is up
  MTU 1500 bytes, BW 2000 Kbit, DLY 20000 usec,
Serial1/1 is up, line protocol is up
  MTU 1500 bytes, BW 2000 Kbit, DLY 20000 usec,
Serial1/2 is up, line protocol is up
  MTU 1500 bytes, BW 2000 Kbit, DLY 20000 usec,
Serial1/3 is administratively down, line protocol is down
  MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec,
Loopback0 is up, line protocol is up
  MTU 1514 bytes, BW 8000000 Kbit, DLY 5000 usec,

You could define an alias to create a new IOS command generating this printout (for example, alias exec bw show interface | include protocol|BW). You could also write a simple Tcl script that would accept an interface name and display the bandwidth of that interface.

7 comments:

  1. Good one. I have a suggestion on a similar note, you can also quickly view input/output (great for tracking down where that spanning tree loop is coming from) using: "show interface | inc line|bits"

    ReplyDelete
  2. I created an alias called sid which shows up/down and down down interfaces. I am not sure about the 11 spaces but you can up arrow and rerun the command modifying the space count until you get a match. Useful command to quickly identify down links on enterprise systems.

    sh int desc | inc up <-- 13 spaces --> down|down <-- 11 spaces(?)---> down

    dakotaglory.com

    ReplyDelete
  3. Ivan Pepelnjak05 March, 2011 16:33

    To match multiple spaces, use ' +' (without quotation marks) or (to make things more explicit) [ ]+

    ReplyDelete
  4. Do you know of a list of system variables that are accessible for CLI use? For example, to "show log | include $DATE" in order to show only today's entries. I did a search on your site for variables and for cli variables. Maybe IOS variables?

    ReplyDelete
  5. Ivan Pepelnjak06 March, 2011 08:30

    Nothing similar available in IOS, its CLI is not sh-like. Use tclsh if you need more scripting capabilities.

    ReplyDelete
  6. Long shot I know but I had to ask...Thanks again.

    ReplyDelete

You don't have to log in to post a comment, but please do provide your real name/URL. Anonymous comments might get deleted.

Ivan Pepelnjak, CCIE#1354, is the chief technology advisor for NIL Data Communications. He has been designing and implementing large-scale data communications networks as well as teaching and writing books about advanced technologies since 1990. See his full profile, contact him or follow @ioshints on Twitter.