ntp access-group
To control access to Network Time Protocol (NTP) services on the system, use the ntp access-group command in global configuration mode. To remove access control to the NTP services, use the no form of this command.
ntp access-group [ipv4 | ipv6] {peer | query-only | serve | serve-only} {access-list-number | access-list-number-expanded | access-list-name} [kod]
no ntp access-group [ipv4 | ipv6] {peer | query-only | serve | serve-only}
Syntax Description
ipv4 |
(Optional) Configures IPv4 access lists. |
||
ipv6 |
(Optional) Configures IPv6 access lists. |
||
peer |
Allows time requests and NTP control queries and permits the system to synchronize with the remote system. |
||
query-only |
Allows only NTP control queries. See RFC 1305 (NTP version 3). |
||
serve |
Allows time requests and NTP control queries, but does not allow the system to synchronize with the remote system. |
||
serve-only |
Allows only time requests.
|
||
access-list-number |
Number (from 1 to 99) of a standard IPv4 or IPv6 access list. |
||
access-list-number-expanded |
Number (from 1300 to 1999) of an expanded range IPv4 or IPv6 access list. |
||
access-list-name |
Name of an access list. |
||
kod |
(Optional) Sends the “Kiss-of-Death” (KOD) packet to any host that tries to send a packet that is not compliant with the access-group policy. |
Command Default
By default, there is no access control. Full access is granted to all systems.
Command Modes
Global configuration (config)
Command History
Release |
Modification |
---|---|
10.0 |
This command was introduced. |
12.4(15)T |
This command was modified in a release earlier than Cisco IOS Release 12.4(15)T. The access-list-number-expanded argument was added. |
12.2(33)SRA |
This command was integrated into Cisco IOS Release 12.2(33)SRA. |
12.2SX |
This command is supported in the Cisco IOS Release 12.2SX train. Support in a specific 12.2SX release of this train depends on your feature set, platform, and platform hardware. |
12.4(20)T |
This command was modified. The access-list-name argument and kod keyword were added. Support for IPv6 was added. |
12.2(33)SXJ |
This command was modified. The access-list-name argument and kod keyword were added. Support for IPv6 was added. |
Cisco IOS XE Release 3.3S |
This command was integrated into Cisco IOS XE Release 3.3S. Support for IPv6 access list was added. |
Cisco IOS XE Release 3.5S |
This command was modified. The ipv4 and ipv6 keywords were added. |
15.2(1)S |
This command was integrated into Cisco IOS Release 15.2(1)S. |
Usage Guidelines
The access group options are scanned in the following order from the least restrictive to the most restrictive:
-
peer
-
query-only
-
serve
-
serve-only
Access is granted for the first match that is found. If no access groups are specified, comprehensive access is granted to all sources. If you specify any access groups, only the specified access is granted. This facility provides minimal security for the time services of the system. However, it can be circumvented by a determined programmer. For tighter security, use the NTP authentication facility.
The NTP service can be activated by entering any ntp command. When you use the ntp access-group command, the NTP service is activated (if it has not already been activated) and access control to NTP services is configured simultaneously.
When you enter the no ntp access-group command, only the access control to NTP services is removed. The NTP service itself remains active, along with any other previously configured NTP functions.
To disable the NTP service on a device, use the no ntp command without any keywords in global configuration mode. For example, if you want to remove the access control to NTP services, and all NTP functions from the device, use the no ntp command without any keywords.
If you do not specify the ipv4 or ipv6 keyword, the IPv4 access list is configured by default. In Cisco IOS XE Release 3.5S and later releases, the show running-config command displays only the last configured ntp access-group command configured on the router. However, in releases prior to Cisco IOS XE Release 3.5S, the show running-config command displays all ntp access-group commands configured on the router. For example, in Cisco IOS XE Release 3.5S and later releases, if you first configure the ntp access-group serve 1 command and then configure the ntp access-group serve 2 command on the router, the output of the show running-config displays only the ntp access-group serve 1 command, shown below:
Router# configure terminal
Router(config)# ntp access-group serve 2
Router(config)# ntp access-group serve 1
Router(config)# exit
Router# show running-config | include ntp access-group
ntp access-group serve 1
Router#
Examples
The following example shows how to configure a system to allow itself to be synchronized by a peer from access list 99. However, the system restricts access to allow only time requests from access list 42.
Router(config)# ntp access-group peer 99
Router(config)# ntp access-group serve-only 42
In the following IPv6 example, a KOD packet is sent to any host that tries to send a packet that is not compliant with the access-group policy:
Router(config)# ntp access-group serve acl1 kod
The following example shows how to remove all the configured NTP options and disable the NTP server:
Router(config)# no ntp