NTP¶
Network Time Protocol (NTP) is a networking protocol for clock synchronization. Basically the required parameters are the peer(s) with which you accept to exchange information, and the frequency of updates.
Client¶
Only one NTP client can be enabled at a time.
Here is an example on querying one NTP server with the parameter iburst set to enable burst synchronization:
vrouter running config# vrf main
vrouter running vrf main# ntp
vrouter running ntp# time-sources server my.timeserver.com iburst true
vrouter running ntp# commit
To check the state:
vrouter running config# show state vrf main ntp
ntp
time-sources
server my.timeserver.com
synchronized true
stratum 6
offset 19
state system-peer
version 4
association-type SERVER
root-delay 340
iburst true
prefer false
root-dispersion 29
..
..
..
To show the state in a human readable way:
vrouter running config# show ntp vrf main
NTP synchronized with my.timeserver.com at stratum 6.
time correct within 19 ms.
The same configuration can be made using this NETCONF XML configuration:
vrouter running config# show config xml absolute vrf main ntp
<config xmlns="urn:6wind:vrouter">
<vrf>
<name>main</name>
<ntp xmlns="urn:6wind:vrouter/ntp">
<enabled>true</enabled>
<server>
<address>my.timeserver.com</address>
<iburst>true</iburst>
<version>4</version>
<association-type>SERVER</association-type>
<prefer>false</prefer>
</server>
</ntp>
</vrf>
</config>
Server¶
Here is an example where Turbo Router will act as a server. It will answer to all synchronization requests except from the subnet 192.168.2.0/24:
vrouter running config# vrf main
vrouter running vrf main# ntp
vrouter running ntp# server-subnet 0 allow all
vrouter running ntp# server-subnet 3 deny 192.168.2.0/24
vrouter running ntp# commit
Note
The server can also act as an NTP client.
To check for state:
vrouter running config# show state vrf main ntp
ntp
server-subnet 0 allow all
server-subnet 3 deny 192.168.2.0/24
..
The same configuration can be made using this NETCONF XML configuration:
vrouter running config# show config xml absolute vrf main ntp
<config xmlns="urn:6wind:vrouter">
<vrf>
<name>main</name>
<ntp xmlns="urn:6wind:vrouter/ntp">
<enabled>true</enabled>
<server-subnet>
<num>0</num>
<allow>all</allow>
</server-subnet>
<server-subnet>
<num>3</num>
<deny>192.168.2.0/24</deny>
</server-subnet>
</ntp>
</vrf>
</config>
To show the NTP clients synchronized with Turbo Router:
vrouter running config# show ntp clients
Host NTP recv pkts NTP drop pkts NTP last pkt (s) Cmd recv pkts Cmd drop pkts Cmd last pkt (s)
=============== ============= ============= ================ ============= ============= ================
192.168.1.100 17 0 5 2 0 15
10.45.1.50 125 0 12 0 0 -
See also
The command reference for details.