12.07.2015 Views

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

Red Hat Enterprise Linux 5 Administration Unleashed

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Keeping Accurate Time with NTP 397After the time is roughly synchronized, the daemon will exit.If the current system time and the time retrieved from the NTP server are more than1,000 seconds apart, ntpd will exit and not modify the system time. To force the time tosync regardless of the time difference, use the -g option in addition to the -q option:nptd -g -q Then, start the service with the service ntpd start command. To stop the service, usethe service ntpd stop command. To enable the service to start automatically at boottime, execute the chkconfig ntpd on command.Configuring the NTP ServerBecause an NTP server must retrieve its time from somewhere, it is also an NTP client.Configure the system as an NTP client first, and then follow the instructions from thissection. As with the NTP client, the ntp package must be installed on the system toconfigure an NTP server.An NTP server can be configured so that each client must specify its IP address or hostnamefor access, or an NTP server can be configured in multicast mode to allow clients tofind it.The default /etc/ntp.conf file contains the following line near the top of the file:restrict default nomodify notrap noqueryThis line configures default restrictions for all connections with the default keyword. Thedefault restrictions can be overridden with restrict statements about specific networkranges. The nomodify, notrap, and noquery access control options mean that the servercan not be modified, control message trap service is denied, and all time sync queries aredenied.If a subnet is specified and the noquery keyword is omitted, the server is allowed to acceptconnections from the specified subnet (replace subnet):restrict 192.168.0.0 mask 255.255.255.0 nomodify notrapMultiple restrict lines can be added to allow multiple subnets to connect to the NTP server.To configure the NTP daemon to work in multicast mode where clients can find itwithout knowing its hostname or IP address, use the following line in /etc/ntpd.conf:19broadcast 224.0.1.1 ttl 4Notice the 244.0.1.1 address. The Internet Assigned Numbers Authority (IANA) hasassigned the multicast group address 224.0.1.1 for IPv4 and ff05::101 (site local) for IPv6exclusively to NTP.After modifying the ntp.conf file, use the service ntpd restart command to enable thechanges.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!