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:
vsr running config# / vrf main ntp time-sources server ntp.6wind.com iburst true
To check the state:
vsr> show state / vrf main ntp
ntp
enabled true
time-sources
makestep
threshold 1000
limit 3
..
server ntp.6wind.com
version 4
association-type SERVER
iburst true
prefer false
stratum 3
root-delay 16
root-dispersion 30
offset 0
poll-interval 64
synchronized true
state system-peer
..
..
..
To show the state in a human readable way:
vsr> show ntp vrf main
NTP synchronized with ntp.6wind.com at stratum 3.
time correct within 0 ms.
The same configuration can be made using this NETCONF XML configuration:
vsr> 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>
<time-sources>
<makestep>
<threshold>1000</threshold>
<limit>3</limit>
</makestep>
<server>
<address>ntp.6wind.com</address>
<version>4</version>
<association-type>SERVER</association-type>
<iburst>true</iburst>
<prefer>false</prefer>
</server>
</time-sources>
</ntp>
</vrf>
</config>
Server¶
Here is an example where Virtual Service Router will act as a server. It will answer to all synchronization requests except from the subnet 192.168.2.0/24:
vsr running config# vrf main
vsr running vrf main# ntp
vsr running ntp# server-subnet 0 allow all
vsr running ntp# server-subnet 3 deny 192.168.2.0/24
vsr running ntp# commit
Note
The server can also act as an NTP client.
To check for state:
vsr 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:
vsr 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 Virtual Service Router:
vsr 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.