Interface Command?

Answered Question
Jun 27th, 2008
User Badges:

is there such a command in cisco ios to check how long an interface has been up?


Correct Answer by Joe Clarke about 8 years 10 months ago

No. This could run from a network server:

tclsh tftp://

However, you could copy it to flash if you wanted.

  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 5 (2 ratings)
dhananjoy chowdhury Sat, 06/28/2008 - 05:15
User Badges:
  • Silver, 250 points or more


There is no such command. But router uptime can be obtained (sh verion). And Last input / Last output also (sh int f0/0).

Instead I would suggest either you use a Syslog server to log the interface up/down messages or a SNMP tool (OpenNMS), which would be the best option.

Joe Clarke Sun, 06/29/2008 - 21:40
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

If your device is running 12.3(7)T or higher (or a 6500 running 12.2(18)SXF5 or higher), you can use this Tcl script to get the uptime for an interface. You can run it like:

Router#tclsh flash:int-uptime.tcl --interface FastEthernet0/0 --community public

Interface FastEthernet0/0 has been in its current state for 4 weeks, 5 days, 8 hours, 34 minutes, 47 seconds (since Tue May 27 16:59:58 EDT 2008)

You can run the script with --help or --usage to get usage help. This tool uses the SNMP object ifLastChange to determine the last time an interface changed state. If the interface is currently up, then the time shown will be the interface uptime.



This Discussion