Restricting Peers
Problem
You want to restrict whom your router will provide NTP services to.
Solution
You can use the ntp access-group command to restrict which devices you want your router to allow NTP associations with:
Router#configure terminalEnter configuration commands, one per line. End with CNTL/Z. Router(config)#access-list88permit hostRouter(config)#172.25.1.1access-list88permit hostRouter(config)#10.1.1.1access-list99permitRouter(config)#172.25.0.0 0.0.255.255access-list99permitRouter(config)#10.2.0.0 0.0.255.255clock timezoneRouter(config)#EST -5clock summer-timeEDTrecurringRouter(config)#ntp server172.25.1.1versionRouter(config)#3ntp server10.1.1.1versionRouter(config)#3ntp access-group peerRouter(config)#88ntp access-group serve-onlyRouter(config)#99endRouter#
Discussion
In this example, the router will allow the internal clock to be
synchronized by the two NTP servers listed in access-list number
88, 172.25.1.1, and 10.1.1.1. The router also allows time
requests only from the client devices permitted by access-list
99.
By default, NTP has no access controls, and it gives full access to all NTP devices. The ntp access-group command limits this access to various NTP services. In the example above, the peer keyword means that the router will only allow its internal clock to be changed by those remote servers and peers permitted by the access-list.
The serve-only keyword specifies the clients permitted to obtain time services from the router. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access