[ntp:questions] Errors in "restrict" lines

Harlan Stenn stenn at ntp.org
Mon Jun 26 07:13:57 UTC 2017


David Taylor writes:
> Folks,
> 
> I will be the first to admit that I'm not very conversant with 
> "restrict" lines, so perhaps the following will be obvious to you!  I 
> have in lines 34 onwards of my ntp.conf:
> 
> # Suggestions for NTP restrictions:
> restrict source notrap nomodify nopeer query
> restrict 127.0.0.1
> restrict ::1
> restrict 192.168.0.0 mask 255.255.255.0 peer
> 
> and NTP is giving the following error messages:
> 
> Jun 26 05:58:10 raspi-4 ntpd[2776]: line 35 column 29 syntax error, 
> unexpected T_String, expecting T_EOC
> Jun 26 05:58:10 raspi-4 ntpd[2776]: syntax error in /etc/ntp.conf line 
> 35, column 29
> Jun 26 05:58:10 raspi-4 ntpd[2776]: line 38 column 32 syntax error, 
> unexpected T_Peer, expecting T_EOC
> Jun 26 05:58:10 raspi-4 ntpd[2776]: syntax error in /etc/ntp.conf line 
> 38, column 32
> 
> I am at a loss to explain these errors....

'query' is not the opposite of 'noquery'.  Don't use it.

'peer' is not the opposite of 'nopeer'.  Don't use it.

If you want to disallow something, add 'noFOO' to the restrict list.
Anything not disallowed is allowed.
-- 
Harlan Stenn <stenn at ntp.org>
http://networktimefoundation.org - be a member!


More information about the questions mailing list