cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3508
Views
25
Helpful
11
Replies

Cisco 2960XR connecting to NTP server (ntp restriction)

SJ K
Level 5
Level 5

Hi all,

I have the following requirements ->

1) I need to connect my switch to an NTP server 192.168.4.5

2) My switch will only synchronize itself with 192.168.4.5

3) My switch will not respond or peer or handle any time query, control query with any other server.

In my switch, I configured the following

ntp server 192.168.4.5

ntp access-group peer 10

access-list 10 permit 192.168.4.5

q1) Can what I have configure fulfilled my above requests ? I do not want my switch to handle any other ntp queries at all with any other devices in the network.  Do I have to add anything else ?

q2) If I have created and ntp access-group but does not have the corresponding access list, does it means I will allow my device to peer with every other devices ?

WEB1#show ntp status
Clock is synchronized, stratum 3, reference is 192.168.1.6

ntp server 192.168.1.6 
ntp access-group peer 10  -- but I do not have any access list 10 defined.  why is my switch still synchronized ?!

Regards,

Noob

1 Accepted Solution

Accepted Solutions

Hi yes you should be able to once you set the ntp server x.x.x.x. for the internet ntp ,once that is synced , then on your other devices you can set them to have ntp server as well but you point it to the router itself internal ip address and it should sync off that then

View solution in original post

11 Replies 11

Mark Malone
VIP Alumni
VIP Alumni

Hi

q1) Can what I have configure fulfilled my above requests ? I do not want my switch to handle any other ntp queries at all with any other devices in the network.  Do I have to add anything else ?

Yes it will work with what you want  but I would always use v4 where possible as its more secure use keys and authentication but its optional

..............

From the doc below if you want to prevent other devices getting NTP then you need to lock it down

You can control access to NTP services by using access groups. Specifically, you can specify the types of requests that the device allows and the servers from which it accepts responses.

If you do not configure any access groups, NTP access is granted to all devices. If you configure any access groups, NTP access is granted only to the remote device whose source IP address passes the access list criteria.

ntp access-group peer 10  -- but I do not have any access list 10 defined.  why is my switch still synchronized ?! 

Then the access-group is not in use its open like having no acl so it can sync with everything

Hi Mark,

Thanks for your reply.

From the doc below if you want to prevent other devices getting NTP then you need to lock it down.
If you do not configure any access groups, NTP access is granted to all devices. If you configure any access groups, NTP access is granted only to the remote device whose source IP address passes the access list criteria.

If I have configured the following

ntp server 192.168.4.5

ntp access-group peer 10

access-list 10 permit 192.168.4.5

With the access group and access list defined -> Does it means that I have locked down the switch and prevent other devices from doing NTP requests on the switch ?

Regards,
Noob

Hi

what you have in place is fine its locked down you could go trust keys for extra security but may be overkill , the issue will occur though when you do go to peer and an access-group is still in place on the master ntp device , even if you peer by allowing another ip in the acl you must allow the internal ip address that ntp uses in the access-list 127.127.7.1, this is what the local routers would sync to internally if that's not in place any router that connects to your master will stay out of sync until the acl is corrected , just something to remember when using ntp access-group

Hi Mark,

Thanks for your reply.

Just 1 question, can i configure a switch/router to be both a NTP server and client at the same time.

It seems like if if i create the switch/router to become an NTP master, it start to sync itself with its internal clock.

What should I do if I wanted the router to sync to an external source, and yet is also the source providing to all the internal devices.

=======

Can a router serves time requests without becoming an NTP master ?


Regards,
Noob

Hi

It seems like if if i create the switch/router to become an NTP master, it start to sync itself with its internal clock.

Yes that's correct ......

When the router is using its own clock as a master clock (using the ntp master command), the output from show ntp associations looks like the following:

address            ref clock     st    when   poll   reach   delay    offset    disp 
*~127.127.7.1      127.127.7.1   6     20     64     377     0.0      0.00     0.0 
* master (synced), # master (unsynced), + selected, - candidate, ~ configured

The interesting value here is in the stratum field, which is one less than the configured value, ntp master 7 in this case. The router polls its own internal clock, but the clock is never unreachable, and the router never increases the poll interval to more than every 64 seconds.

What should I do if I wanted the router to sync to an external source, and yet is also the source providing to all the internal devices.

NTP server x.x.x.x prefer  will do it on the main router pointing to an external clock (set multiple clocks and chose the best stratum), you can have multiple servers and then also set it as a master to server time and then set the other switches to use the the master for its time

Can a router serves time requests without becoming an NTP master ? hmm doubt it , needs the master to serve clock times from what I remember

Hi Mark,

Thanks for your reply.

NTP server x.x.x.x prefer  will do it on the main router pointing to an external clock (set multiple clocks and chose the best stratum), you can have multiple servers and then also set it as a master to server time and then set the other switches to use the the master for its time

But when you set a switch with the "ntp master" command, it no longer peers with an external clock source already right ?

Looking at the ntp association, its only peer it is own clock - isn't it ?

I need the switch/router to be sync to an external ntp server on the internet and that switch/router will also be the ntp source for rest of the internal devices (that are not able to reach the internet)  --> if I set the switch/router to become NTP master, can it still sync to external source ?

Regards,
Noob

Actually if the switch is set with ntp server and the ntp access group is not in place your other devices will be able to peer with it by pointing to that switch with the external ntp server , theres no requirement for the master syntax

Hi Mark,

Thanks for your reply.

Since a router/switch that is internet facing can still sync with an external source and yet still provide / be the ntp source for the internal devices being the NTP master,  then what is the point of having the "ntp master" command  ?

Regards,
Noob

Some companies due to security will not allow any internet facing ntp servers , ntp is not that secure , there are a lot of vulnerabilities so you have master as well you an set the clock locally and source of that if required and take the clock locally only and then peer tat to other switches , by the way the algorithms in a cisco ios are not as good as and external clock service so eventually the time always shifts off very little bit by bit that's why some will still use public servers but try mitigate the vulnerabilities as much as possible to prevent issues

Like this we were flagged this only last week by our internal security teams , we were effected by it in the S3 version in IOS-XE and had to put in preventative measures

Cisco Security Advisory

Cisco IOS and IOS XE Software Crafted Network Time Protocol Packets Denial of Service Vulnerability

High
Advisory ID:
cisco-sa-20160804-wedge
First Published:
2016 August 4 16:00  GMT
Last Updated: 
2016 August 9 12:39  GMT
Version 1.1:
Final
Workarounds:
No workarounds available
Cisco Bug IDs:
CVE-2016-1478
CVSS Score:
Base 7.8, Temporal 6.4Click Icon to Copy Verbose Score
AV:N/AC:L/Au:N/C:N/I:N/A:C/E:F/RL:OF/RC:C
CVE-2016-1478

Hi Mark,

Thanks for the information.

So in my situation, whereby I have a switch/router that is facing the internet and is able to sync to an external source, I do not need to use "ntp master" on the switch/router itself to allow/enable my internal devices to use it as a time source right ?

Regards,
Noob

Hi yes you should be able to once you set the ntp server x.x.x.x. for the internet ntp ,once that is synced , then on your other devices you can set them to have ntp server as well but you point it to the router itself internal ip address and it should sync off that then