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
vsr running vrf main# ntp
vsr running ntp# time-sources server my.timeserver.com iburst true
vsr running ntp# commit

To check the state:

vsr 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:

vsr 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:

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>
        <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 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.