Configure NTP Basic Functions
Configuration Condition
Before configuring the NTP basic functions, first complete the following task:
- Configure the network layer address of the interface, making the network layer between the NTP clock service requester and clock service provider reachable.
- The NTP clock service provider enables NTP.
Configure NTP Client/Server Mode
When using the NTP client/server mode, do not need special configuration on the server, but it is necessary to ensure that the serve clock is synchronized and the clock layers of the server are smaller than the clock layers of the client.
Perform the following configuration on the NTP client.
Table 4-2 Configure the NTP client
Step
|
Command
|
Description
|
Enter the global configuration mode
|
configure terminal
|
-
|
Specify the NTP server
|
ntp server [ vrf vrf-name ] { ip-address | ipv6 ipv6-address | domain-name } [ version version-number | key key-number | source interface-name ]*
|
Mandatory
By default, do not specify the NTP server.
|
-
The ip-address parameter is one unicast address, but cannot be the broadcast address, multicast address or IP address of the local device.
- The ipv6-address parameter is one global unicast address or Link-Local address, but cannot be the multicast address.
- After specifying the source interface of the client packet via source interface-name, the master IP address of the interface or the first global unicast IPv6 address is set as the source IP address of the packet sent by the client. If the configured server address is IPv6 Link-local address, you should specify the source interface.
- You can specify multiple servers by configuring the ntp server or ntp server ipv6 command for multiples times. You can specify 64 servers at most (the total of ipv4+ipv6+domain names).
Configure NTP Peer Mode
When using the NTP peer mode, do not need special configuration on the passive peer, but it is necessary to ensure that the passive peer can receive and send the NTP packet. You can enable NTP by configuring the ntp enable (ipv6) command on the passive peer or any NTP command in “1.2.1 Configure NTP Basic Functions”.
Perform the following configuration on the NTP active peer.
Table 4-3 Configure the NTP active peer
Step
|
Command
|
Description
|
Enter the global configuration mode
|
configure terminal
|
-
|
Specify the NTP passive peer
|
ntp peer [ vrf vrf-name ] { ip-address | ipv6 ipv6-address | domain-name } [ version version-number | key key-number | source interface-name ] *
|
Mandatory
By default, do not specify the NTP passive peer.
|
-
The ip-address parameter is one unicast address, but cannot be the broadcast address, multicast address or IP address of the local device.
- The ipv6-address parameter is one global unicast address or Link-Local address, but cannot be the multicast address.
- After specifying the sending source interface of the active peer packet via source interface-name, the master IP address of the interface or first global unicast IPv6 address is set as the source IP address of the packet sent by the active peer. If the configured peer address is the IPv6 Link-local address, you should specify the source interface.
- You can specify multiple passive peers by configuring the ntp server or ntp peer ipv6 command for multiples times. You can specify 64 passive peers at most (the total of IPv4+IPv6 +domain name).
Configure NTP Broadcast Mode
When using the NTP broadcast mode, the broadcast server and broadcast client both need to be configured and it is necessary to ensure that the clock of the broadcast server is synchronized and the clock layers are smaller than the clock layers of the broadcast client. It is necessary to specify one interface for sending the NTP broadcast packet on the broadcast server and one interface for receiving the NTP broadcast packet on the broadcast client, so the configuration of the broadcast mode can only be performed in the specific interface mode.
Perform the following configuration on the NTP broadcast client.
Table 4-4 Configure the NTP broadcast client
Step
|
Command
|
Description
|
Enter the global configuration mode |
configure terminal |
- |
Enter the interface configuration mode
|
interface interface-name
|
-
|
Enable the NTP broadcast client on the interface
|
ntp broadcast client
|
Mandatory
By default, the interface does not enable the NTP broadcast client.
|
Perform the following configuration on the NTP broadcast server.
Table 4-5 Configure the NTP broadcast server
Step
|
Command
|
Description
|
Enter the global configuration mode
|
configure terminal
|
-
|
Enter the interface configuration mode
|
interface interface-name
|
-
|
Enable the NTP broadcast server on the interface
|
ntp broadcast-server [ key key-number | version version-number ]*
|
Mandatory
By default, the interface does not enable the NTP broadcast server.
|