< Day Day Up > |
Recipe 19.4. Adding Access Controls19.4.1 ProblemYou want to be sure your local clients look like clients, and not ntp servers. You want them to receive time service only, and from only the specified servers. 19.4.2 SolutionAdd some access rules in /etc/ntp.conf, or you may add a couple of iptables rules to the client's firewall to allow time service only, and to disallow everything else. To use ntp's access controls, add these lines to /etc/ntp.conf: # default access policy # this denies all ntp traffic that is not # explicitly allowed restrict default ignore # allow time service from this server # do not allow peering # do not allow runtime configuration changes # do not allow remote logging restrict 192.168.1.101 nopeer nomodify notrap # we trust localhost restrict 127.0.0.0 mask 255.0.0.0 Remember to restart ntpd after making changes to ntp.conf. An alternative to adding access rules to ntp.conf is to use these iptables rules. If the client machines are running iptables, add these rules to create a client that accepts only time service and rejects everything else: iptables -A INPUT -p udp --dport 123 -m state --state ESTABLISHED -j ACCEPT iptables -A INPUT -p udp --dport 123 -j REJECT The first rule accepts all responses to sent ntp packets, and the second denies all others. Any host attempting to initiate a connection will be blocked, but responses to the client's own requests will be allowed. 19.4.3 DiscussionHere are some of the ntp.conf configuration options explained:
The main reasons for using access controls are to prevent your clients from becoming the timekeepers to the world, and to keep order and sanity in your network. 19.4.4 See Also
|
< Day Day Up > |