5-8
Catalyst 2360 Switch Software Configuration Guide
OL-19808-01
Chapter 5 Administering the Switch
Managing the System Time and Date
3.
serve-only
—Allows only time requests from a device whose address passes the access list criteria.
4.
query-only
—Allows only NTP control queries from a device whose address passes the access list
criteria.
If the source IP address matches the access lists for more than one access type, the first type is granted.
If no access groups are specified, all access types are granted to all devices. If any access groups are
specified, only the specified access types are granted.
To remove access control to the switch NTP services, use the
no ntp access-group
{
query-only
|
serve-only
|
serve
|
peer
} global configuration command.
This example shows how to configure the switch to allow itself to synchronize to a peer from access
list 99. However, the switch restricts access to allow only time requests from access list 42:
Switch#
configure terminal
Switch(config)#
ntp access-group peer 99
Switch(config)#
ntp access-group serve-only 42
Switch(config)#
access-list 99 permit 172.20.130.5
Switch(config)#
access list 42 permit 172.20.130.6
Configuring the Source IP Address for NTP Packets
When the switch sends an NTP packet, the source IP address is normally set to the address of the
interface through which the NTP packet is sent. Use the
ntp source
global configuration command when
you want to use a particular source IP address for all NTP packets. The address is taken from the
specified interface. This command is useful if the address on an interface cannot be used as the
destination for reply packets.
Beginning in privileged EXEC mode, follow these steps to configure a specific interface from which the
IP source address is to be taken:
The specified interface is used for the source address for all packets sent to all destinations. If a source
address is to be used for a specific association, use the
source
keyword in the
ntp peer
or
ntp server
global configuration command as described in the
“Configuring NTP Associations” section on page 5-5
.
Displaying the NTP Configuration
You can use two privileged EXEC commands to display NTP information:
•
show ntp associations
[
detail
]
•
show ntp status
For detailed information about the fields in these displays, see the
Cisco IOS Configuration
Fundamentals Command Reference, Release 12.2
.
Command
Purpose
Step 1
configure terminal
Enter global configuration mode.
Step 2
ntp source
type number
Specify the interface type and number from which the IP source address
is taken.
By default, the source address is set by the outgoing interface.
Step 3
end
Return to privileged EXEC mode.
Step 4
show running-config
Verify your entries.
Step 5
copy running-config startup-config
(Optional) Save your entries in the configuration file.