NTP service configuration in linux

PURPOSE

All servers which are in internal network adopt NTP service to keep time consistent with each other,avoiding bussiness abnormal due to time issue.

ROLES

Cisco Firewall 192.168.10.5/24 basic system is wind river OS(Linux)

Internal server 192.168.10.15/24 basic system is rhel6.5

SOLUTION

Firewall is configured as a NTP client of external network, it will get exact time from internet and it is also as a NTP server of internal network, providing exact time to all internal servers. Internal servers are configured as NTP client, they will fetch exact time from firewall regularly.

Firewall configuration

Edit ntp configuration file vim /etc/ntp.conf

server 0.centos.pool.ntp.org iburst restrict 192.168.8.0 mask 255.255.255.0 nomodify
restrict 192.168.9.0 mask 255.255.255.0 nomodify
restrict 192.168.10.0 mask 255.255.255.0 nomodify
restrict 192.168.11.0 mask 255.255.255.0 nomodify driftfile /var/lib/ntp/ntp.drift
logconfig=syncall +clockall +sysall +peerall
logfile /opt/cisco/platform/logs/ntp.log

Restart ntp service

Check ntp server time

Internal servers configuration

Edit ntp configuration file

vim /etc/ntp.conf

driftfile /var/lib/ntp/drift restrict default kod nomodify notrap nopeer noquery restrict -6 default kod nomodify notrap nopeer noquery restrict 127.0.0.1 restrict -6 ::1 server 192.168.0.5 iburst includefile /etc/ntp/crypto/pw keys /etc/ntp/keys

save and exit

vim /etc/ntp/step-tickers

# List of servers used for initial synchronization. 192.168.100.45

save and exit

Restart ntp client

Set ntp startup automatically

chkconfig ntpd on

Check ntp status

At this point , ntp configuration have been completed.

Leave a Reply