I’m trying to configure NTP server. It is working but working is not enough i think. It is good to have some security introduced, so I try to understand how can I restrict that server. I found that handbook: Clock Synchronization with NTP
It is for FreeBSD but I think that NTP have to behave the same there.
There is:
restrict default ignore
Note: This will also prevent access from your server to any servers listed in your local configuration. If you need to synchronise your NTP server with an external NTP server you should allow the specific server. See the ntp.conf(5) manual for more information.
So I tried to use:
restrict default ignore
in my cfg file and server can connect to other server using command
rcntp ntptimeset
Why it is possible? Isn’t command restrict default ignore restricting that?
I can’t also understand why when I add that to cfg:
restrict 10.50.12.0 mask 255.255.255.0 noquery
network 10.50.12.0/24 can query NTP server.
May by that are stupid question but I can’t find easy answers how ACLs in NTP are working. If order is important…
I just want to create very easy ACL - permit local NTP server to ask one external server about time and permit local network to ask local server about time.
I try to understand what you wrote, but imho I am missing information. Or this may be much beyond my (basic) NTPP knowledge.
E.g. when your citation says “This will also prevent access from your server to any servers listed in your local configuration”. You do not tell how you interprete this, I guess they mean with “your server to any servers” to say “your server, acting as a client, to any servers”. And what is the meaning of “local configuration” Is there an other one?
You mentioning ntptimesetin a command is not very illustrating because we do not know what the IP address is and thus not if it is in your LAN or not.
While it looks logical to me that you want to restrict service requests to your local LAN, I guess that
restrict 10.50.12.0 mask 255.255.255.0
would do that. As the man page says:
noquery
Deny ntpq(8) and ntpdc(8) queries. Time service is not
affected.
I guess that any system in 10.50.12.0/24 can still sync time with your server. Or do I misineterprete here?
IMHO because you configured your NTP client to use 1.pool.ntp.org to use as a server. Which it dully does.
And you configured your NTP server to ignore clients, but you did not test that using a client.
Again imho NTP server and NTP client, while being located in the same system and even being executed by the same program (ntpd) are different things with their own configuration.