DbAppWeb.com

Menu
  • Home
  • Linux
  • HP-UX
  • macOS
  • Windows
  • Web Servers
  • App Servers
  • Storage

Whitelist a Range of IP Addresses in Linux

September 4, 2020 DbAppWeb Admin

Problem

I have an NTP server (Linux) and other servers are syncing their time with this NTP server. There are many servers are in the same network which can take time from the NTP server. But I want that only some servers in a range of IP addresses can take time from my NTP server.

 

Solution

To whitelist a range of IP addresses, I have applied a rule on my Linux NTP server firewall. I have added the below rule in /etc/sysconfig/iptables file for the IP address range 10.20.2.31 to 10.20.2.40. Here I have used the port 123 as this port is required for ntp service.

[root@ntpserver ~]# vi /etc/sysconfig/iptables
.
.
-A INPUT -p udp -m iprange --src-range 10.20.2.31-10.20.2.40 --dport 123 -j ACCEPT
.
.

Restart the firewall using the below command

[root@ntpserver ~]# service iptables restart
iptables: Setting chains to policy ACCEPT: filter          [  OK  ]
iptables: Flushing firewall rules:                         [  OK  ]
iptables: Unloading modules:                               [  OK  ]
iptables: Applying firewall rules:                         [  OK  ]
[root@ntpserver ~]#

Now, servers having IP address only in range 10.20.2.31 to 10.20.2.40 will be able to take the time from NTP server, others will not.

Last Updated: September 04, 2020

Related Posts

  • Synchronize time with NTP server on Windows Server 2003 R2
  • An error occurred getting the status of last synchronization. The RPC server is unavailable.

Share this:

  • Click to share on Twitter (Opens in new window)
  • Click to share on Facebook (Opens in new window)
  • Click to share on LinkedIn (Opens in new window)
  • Click to share on Telegram (Opens in new window)
  • Click to share on WhatsApp (Opens in new window)
Prev Article
Next Article
Tags:Linux Network Admin Networking Sys Admin System Security

Leave a Reply Cancel Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  • Popular
  • Recent

Categories

  • Android (2)
  • Blogger (16)
  • Domain and Hosting (1)
  • Hardware Issues (7)
  • HP-UX (55)
  • HPE Data Protector (9)
  • IBM Lotus Notes (2)
  • IBM WebSphere Application Server (16)
  • Internet Tips & Tricks (15)
  • iOS (8)
  • JBoss/WildFly Application Server (2)
  • Linux (76)
  • macOS (15)
  • Microsoft Windows (31)
  • News and Updates (11)
  • Oracle Database (5)
  • SSL/TLS (1)
  • Storage Servers (23)
  • Tools/Softwares (1)
  • VMware ESXi (17)
  • Web Servers (14)
  • WordPress (5)

Archives

DbAppWeb.com

Solution of Database, Application and Web Server Problems

About DbAppWeb.com

One Stop Solution for Database Server, Application Server and Web Server Problems.

Subscribe to Blog via Email

Enter your email address to subscribe to this blog and receive notifications of new posts by email.

DbAppWeb on Social Media

Copyright © 2025 DbAppWeb.com
Terms and Conditions   Theme by MyThemeShop.com