By default, the system is an NTP client. You must configure NTP client parameters to start NTP client operation. You can also configure the system as an NTP server, whether or not you configure NTP client parameters.
Before you can configure NTP client parameters or enable a virtual router to act as an NTP server, you must enable NTP services. When you enable NTP services, the NTP client associates itself with the current virtual router. Because there is only one system clock to update, only the virtual router on which you configure NTP can act as the NTP client. However, any virtual router can act as an NTP server. To enable NTP services:
ntp enable
- host1:boston(config)#ntp enable
To configure the system as an NTP client:
ntp broadcast-client
- host1(config-if)#ntp broadcast-client
ntp broadcast-delay
- host1(config)#ntp broadcast-delay 2000
ntp disable
- host1(config-if)#ntp disable
ntp server
- host1(config)#ntp server 192.35.42.1 version
3 prefer source atm 3/0.1
ping
- host1(config)#ping 192.35.42.1
By default, an NTP server sends a response to the interface from which an NTP request originated. You can now direct responses from all NTP servers to one interface on the system or direct responses from a specific NTP server to a specific interface.
ntp source
- host1(config)#ntp source atm 3/1
You can prevent the system from receiving certain types of broadcasts and specify the servers from which the system will accept NTP broadcasts. To do so:
access-list
- host1(config)#access-list europe permit any
ntp access-group
![]() |
Note: The system can accept, but does not use, NTP control queries. |
- host1(config-line)#ntp access-group peer europe
To enable a virtual router to act as an NTP server:
![]() |
Caution: Be sure that you do not override a valid time source if you specify the stratum of the NTP server. Issuing the ntp master command on multiple systems in the network might lead to unreliable timestamps if those systems do not agree on the time. |
ntp broadcast
- host1:boston(config-if)#ntp broadcast version
4 5
ntp master
![]() |
Caution: Although you can specify a stratum number of 1, the system does not support stratum 1 service. The system can synchronize only with an NTP server, and not directly with an atomic clock or radio clock. |
- host1:boston(config)#ntp master
ntp server enable
- host1:boston(config)#ntp server enable
The following examples show how to configure the system as an NTP client and an NTP server.
Example 1
NTP communications are established on the virtual router boston. The system is a client of the NTP server with IP address 172.16.5.1.
- host1#virtual-router boston
- host1:boston#ping 172.16.5.1
- Sending 5 ICMP echos to 172.16.5.1, timeout = 2 sec.
- .....
- Success rate = 100% (0/5), round-trip min/avg/max = 0/0/0
ms
- host1:boston#configure terminal
- host1:boston(config)#ntp server 172.16.5.1
- host1:boston(config)#ntp enable
Example 2
NTP communications are established on the virtual router boston. The system is specified as an NTP server.
- host1#virtual-router boston
- host1:boston#configure terminal
- host1:boston(config)#ntp server
Example 3
NTP communications are established on the virtual router boston. The router is specified as an NTP broadcast server and synchronizes with NTP server 172.16.5.1. The specified interface enabled for NTP broadcasting is configured with version 4 and poll interval 5 for broadcasting NTP messages.
- host1#virtual-router boston
- host1:boston#configure terminal
- host1:boston#ntp enable
- host1:boston(config)#ntp server 172.16.5.1
- host1:boston(config)#interface fastethernet
9/3
- host1:boston(config-if)#ntp broadcast 4 5
![]() |
Note: In Example 3, the router that acts as the NTP broadcast server must either synchronize to another server or master (specified by the ntp server command) or act as master (ntp master command). |