Description

The interface “Last flapped” timestamp does not reflect accurate information regarding when and how long ago the interface flapped if the system date is modified. 

Symptoms

The "Last configured:" field in "show system uptime" and "Last flapped:" in the "show interface <interface name>" is set based on the current system date/time and does not change if the system date/time is updated. The delta fields indicating how long ago this event occurred may reflect (absurdly) high or lower (even negative) values if the system date is changed to a later date or an earlier date. This is per design.

 

root@Juniper> show system uptime
fpc0:
--------------------------------------------------------------------------
Current time: 2023-08-04 08:48:05 PDT
Time Source:  NTP CLOCK
System booted: 2023-08-02 17:01:50 PDT (1d 15:46 ago)
Protocols started: 2023-08-02 17:03:00 PDT (1d 15:45 ago)                        <<<<<        
Last configured: 2023-08-03 06:28:10 PDT (1d 02:19 ago) by root
 8:48AM  up 1 day, 15:46, 2 users, load averages: 0.24, 0.17, 0.13
 
root@Juniper> show interfaces et-0/0/48 | match flap
  Last flapped   : 2023-08-02 17:21:10 PDT (1d 15:27 ago)                         <<<<<
 
 

When the system date is modified, the timestamp is not updated for "Last configured" and "Last flapped". The delta fields show that the last incident occurred a long time ago based on the "Current time" - "Last configured" or "Last flapped" timestamp.
 
 
root@Juniper> set date 203206130000.00                                           <<<< System date is modified.
Sun Jun 13 00:00:00 PDT 2032

root@Juniper> show system uptime
fpc0:
--------------------------------------------------------------------------
Current time: 2032-06-13 00:00:14 PDT
Time Source:  LOCAL CLOCK
System booted: 2032-06-11 08:11:45 PDT (1d 15:48 ago)
Protocols started: 2032-06-11 08:12:56 PDT (1d 15:47 ago)
Last configured: 2023-08-04 08:49:32 PDT (462w1d 15:10 ago) by root              <<<<<
12:00AM  up 1 day, 15:48, 2 users, load averages: 0.41, 0.24, 0.16

root@Juniper> show interfaces et-0/0/48 | match flap
  Last flapped   : 2023-08-02 17:21:10 PDT (462w3d 06:39 ago)                     <<<<<

 
 
 
When the interface is flapped, the "Last flapped" and the delta fields are updated. 
 
root@Juniper:RE:0% date; ifconfig et-0/0/48 down
Sun Jun 13 00:01:20 PDT 2032
root@Juniper:RE:0% date; ifconfig et-0/0/48 up                                    <<<< Interface is flapped
Sun Jun 13 00:01:28 PDT 2032

root@Juniper> show system uptime
fpc0:
--------------------------------------------------------------------------
Current time: 2032-06-13 00:01:48 PDT
Time Source:  LOCAL CLOCK
System booted: 2032-06-11 08:11:45 PDT (1d 15:50 ago)
Protocols started: 2032-06-11 08:12:56 PDT (1d 15:48 ago)
Last configured: 2023-08-04 08:49:32 PDT (462w1d 15:12 ago) by root              <<<<<
12:01AM  up 1 day, 15:50, 2 users, load averages: 1.37, 0.82, 0.40

root@Juniper> show interfaces et-0/0/48 | match flap
  Last flapped   : 2032-06-13 00:01:35 PDT (00:00:27 ago)                         <<<<<
 



When the system date is modified again, the timestamp is not updated for "Last configured" and "Last flapped".
The delta fields show negative values based on the "Current time" - "Last configured" or "Last flapped" timestamp.

 

root@Juniper> show system uptime
fpc0:
--------------------------------------------------------------------------
Current time: 2023-08-04 08:59:22 PDT
Time Source:  NTP CLOCK                                                           <<<< NTP is re-enabled
System booted: 2023-08-02 17:01:50 PDT (1d 15:57 ago)
Protocols started: 2023-08-02 17:03:01 PDT (1d 15:56 ago)
Last configured: 2032-06-13 00:02:50 PDT (-15:-3:-28 ago) by root                <<<<<
 8:59AM  up 1 day, 15:58, 2 users, load averages: 0.24, 0.33, 0.30

{master:0}
root@Juniper> show interfaces et-0/0/48 | match flap
  Last flapped   : 2032-06-13 00:01:35 PDT (-15:-2:-9 ago)                        <<<<<
 

Solution

Set the date and/or sync NTP first when provisioning the system. 

Modification History

Validated