Home

About Us

Advertisement

Contact Us

PRIVACY POLICY

  • Facebook
  • X
  • Instagram
  • Pinterest
  • WhatsApp
  • RSS Feed
  • TikTok
ALT

Maalavs Blog

Your Trusted Voice Across the World.

  • NEWS
  • Linux Tech Blogs
  • Windows Tech Blogs
  • VIRTUALIZATION Blogs
Search

šŸ“ŒNTP Configuration in Linux favor CentOS/RHEL-7/ 8/ 9ā°

Author: Madhan Gopalakrishnan | Published on : 10-02-2025

Network Time Protocol (NTP) is crucial for keeping system time synchronized across Linux servers and Linux clients. This guide covers the installation, configuration and client-server setup for CentOS/RHEL Linux 7, 8, and 9 with details. šŸš€


šŸ“Œ Step 1: Install NTP or Chrony

šŸ‘‰ CentOS/RHEL 7 uses ntpd (deprecated in RHEL 8+).
šŸ‘‰ CentOS/RHEL 8 & 9 use chronyd (default and recommended).

For CentOS/RHEL 7 (ntpd)

yum install -y ntp

The installed package includes:

  • ntpd: The NTP daemon responsible for synchronizing system time.
  • ntpdate: A tool to manually sync time with an NTP server.
  • ntpstat: A utility to check synchronization status.

For CentOS/RHEL 8 and 9 (Chrony)

yum install -y chrony

The installed package includes:

  • chronyd: The daemon for time synchronization.
  • chronyc: A command-line tool to query and modify Chrony settings.
  • chrony.conf: Configuration file for defining NTP servers and rules.

šŸš€ Step 2: Enable and Start the NTP Service

For CentOS/RHEL 7 (ntpd)

systemctl enable ntpd --now

For CentOS/RHEL 8 and 9 (Chrony)

systemctl enable chronyd --now

šŸ”§ Step 3: Configure NTP Servers

For CentOS/RHEL 7 (ntpd)

Edit the configuration file:

nano /etc/ntp.conf

Replace or add the following servers:

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

Restart the service:

systemctl restart ntpd

For CentOS/RHEL 8 and 9 (Chrony)

Edit the Chrony configuration:

nano /etc/chrony.conf

Add or modify the following lines:

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst

Restart the service:

systemctl restart chronyd

āœ… Step 4: Verify Synchronization

Check if NTP is syncing correctly.

For CentOS/RHEL 7 (ntpd)

ntpq -p

For CentOS/RHEL 8 and 9 (Chrony)

chronyc sources -v

Check system time:

timedatectl status

šŸ”„ Step 5: Allow NTP Through Firewall

firewall-cmd --add-service=ntp --permanent
firewall-cmd --reload

šŸ¢ NTP Server and Client Configuration

šŸ“” Server Configuration (NTP Master)

Edit the NTP configuration file.

For CentOS/RHEL 7 (ntpd)

nano /etc/ntp.conf

Uncomment or add:

restrict default nomodify notrap noquery
restrict 192.168.1.0 mask 255.255.255.0 nomodify notrap
broadcast 192.168.1.255

Restart the service:

systemctl restart ntpd

For CentOS/RHEL 8 and 9 (Chrony)

nano /etc/chrony.conf

Add:

allow 192.168.1.0/24
local stratum 10

Restart the service:

systemctl restart chronyd

šŸ–„ļø Client Configuration

For CentOS/RHEL 7 (ntpd)

Edit /etc/ntp.conf:

server 192.168.1.1 prefer iburst

Restart the service:

systemctl restart ntpd

For CentOS/RHEL 8 and 9 (Chrony)

Edit /etc/chrony.conf:

server 192.168.1.1 iburst

Restart the service:

systemctl restart chronyd

šŸ“Š Check Time Synchronization

For CentOS/RHEL 7:

ntpq -p

For CentOS/RHEL 8 and 9:

chronyc tracking

šŸŽ‰ Congratulations! Your NTP server and clients are now synchronized! šŸš€

Featured Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025
  • Manchester United Announces Job Cuts Amid Financial Restructuring

    Manchester United Announces Job Cuts Amid Financial Restructuring

    February 26, 2025
  • Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    Shannon Sharpe Criticizes Zion Williamson’s Fitness: A Deep Dive into the Controversy

    February 26, 2025

Search

Author Details

Madhan Gopalakrishnan

I am a passionate “tech blogger” with a knack for breaking down complex topics into simple insights or exploring the latest trends in AI With 5 years of experience in IT Infra implementation and maintenance, I love to share knowledge through in-depth articles and practical tips. When not writing, you can find my hobby “traveling to offbeat destinations”.

  • X
  • Instagram
  • TikTok
  • Facebook

Follow Us on

  • Facebook
  • X
  • Instagram
  • VK
  • Pinterest
  • Last.fm
  • TikTok
  • Telegram
  • WhatsApp
  • RSS Feed

Categories

  • Article (15)
  • NEWS (73)

Archives

  • February 2025 (88)

Tags

About Us

Maalavs Magazine

It is your hub for the latest news across all domains, from technology and business to travel and innovation. We bring insightful updates, expert opinions, and engaging content to keep you informed and ahead. Whether you’re a tech enthusiast, a business professional, or a curious reader, we’ve got something for you. Stay updated with Maalavs Magazine!

Latest Articles

  • Insights into Royal Family Dynamics

    Insights into Royal Family Dynamics

    February 26, 2025
  • Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    Over 50 Deaths Linked to ‘Unknown Disease’ in Congo

    February 26, 2025
  • North Korea Accused of Major Cyber Heist

    North Korea Accused of Major Cyber Heist

    February 26, 2025

Categories

  • Article (15)
  • NEWS (73)
  • Instagram
  • Facebook
  • LinkedIn
  • X
  • VK
  • TikTok

Proudly Powered by Maalavs | Maalavs Magazine

Scroll to Top