Saturday, September 7, 2013

NTP Server on JunOS (Juniper Operating Sytem)

Several days ago, I have posted about use 'set date ntp' for set date time on JunOS. This intruction is set date time on JunOS, use NTP server and time-zone.

#### Set NTP server and Time-zone

user@JunOS> show configuration | match ntp | display set     
set system ntp server 192.168.2.2

user@JunOS> show configuration | match time | display set    
set system time-zone Asia/Jakarta

#### Verify and failed 'write to localhost failed: No route to host'

user@JunOS> show ntp status 
/usr/bin/ntpq: write to localhost failed: No route to host

user@JunOS> show ntp associations 
/usr/bin/ntpq: write to localhost failed: No route to host

#### Solve it
#### 1. add 127.0.0.1 in lo0 
#### 2. set static localhost to 127.0.0.1 (optional)

[edit]
user@JunOS# show | compare 
[edit system]
+  static-host-mapping {
+      localhost inet 127.0.0.1;
+  }
[edit interfaces]
+   lo0 {
+       unit 0 {
+           family inet {
+               address 127.0.0.1/32;
+           }
+       }
+   }

#### Verify

user@JunOS> show ntp status          
status=c011 sync_alarm, sync_unspec, 1 event, event_restart,
version="ntpd 4.2.0-a Tue Nov  3 09:45:49 UTC 2009 (1)",
processor="mips", system="JUNOS10.0R1.8", leap=11, stratum=16,
precision=-17, rootdelay=0.000, rootdispersion=0.315, peer=0,
refid=INIT, reftime=00000000.00000000  Thu, Feb  7 2036 13:28:16.000,
poll=4, clock=d5d2d4d5.dd5c7319  Thu, Sep  5 2013 17:00:53.864, state=1,
offset=0.000, frequency=0.000, jitter=0.008, stability=0.000

user@JunOS> show ntp associations    
     remote           refid      st t when poll reach   delay   offset  jitter
==============================================================================
 192.168.2.2     .INIT.          16 -    3   64    0    0.000    0.000 4000.00

The last thing, adjust your devices time, make sure it's accurate.
Happy weekend.


Ref. 
Set Date Time on Cisco Router
Set Date Time on JunOS (Juniper Operating Sytem)

No comments: