1. Build NTP time server


NTP server time

NTP server is used for time synchronization of LAN servers, which can ensure that the time of all servers in LAN is consistent with that of time server. Some applications that require high real-time performance of time must unify the time.

There are also many time servers on the Internet, such asntpdate ntp. fudan. edu. Cn NTP of Fudan University provides Internet time synchronization for free.

If the listening port of NTP server is UDP 123, you need to open the running client access port 123 in the local firewall, and add the following rules to VI / etc / sysconfig / iptables


-A INPUT -m state –state NEW -m udp -p udp –dport 123 -j ACCEPT 

NTP time server configuration: Yum install NTP ntpdate – y install NTP package!


vi /etc/ntp. Conf only modify the following two lines and remove the # number!


server     # local clock                        fudge stratum 10






restrict default ignore

#Turn off all NTP request packets


#Open the internal recursive network interface lo

restrict mask nomodify

#The client in the internal subnet can conduct network timing, but cannot modify the time parameters of the NTP server.


# is the reference of superior time server


#Open server access to our NTP services

driftfile /var/lib/ntp/drift

The time spent in contacting the superior file is recorded in the time spent with the superior file

2. Start NTP time server: service ntpd start

3. Set NTP boot auto start: chkconfig ntpd on

4. Check whether NTP works normally: netstat – tlunp | grep NTP

5. Configure firewall filtering rules: / SBIN / iptables – I input – P UDP — dport 123 – J accept