• Contact Us
  • About Us
  • Privacy Policy
Globedrill
  • Home
  • Linux
  • Travel
  • Contact Us

How to open range of IP addresses on Linux server using Iptables

Linux/08 Oct, 17/877/0
Linux

How to open range of IP addresses using Iptables

 
Allowing accesses to a single IP address is already explained in the previous article. Steps to allow access to multiple IP address is almost the same. Follow the below instructions to whitelist / Allow IP range in IPtables.
 

How to whitelist whole IP address range

Step 1: Log into Linux server via SSH as ‘root’ user

Step 2: Run the command “iptables -A INPUT -s 192.168.2.1/24 -j ACCEPT” to whitelist IP address range

Step 3: Run the command “service iptables save” to save the firewall rule that you have added

In the above example the whole IP address range will be whitelisted. Do the below steps if you want to whitelist only few IP address (Allow small range of IP addresses).

*The IP address range “192.168.2.1/24” in Step 2, should be replaced with the IP address you wish to allow.

Examples :

To whitelist /16 range :

iptables -A INPUT -s 192.168.2.1/16 -j ACCEPT

To whitelist /28 range :

iptables -A INPUT -s 192.168.2.1/28 -j ACCEPT
 

How to whitelist a range of IP’s in Iptables Firewall without specifying CIDR

 
Step 1: Log into Linux server via SSH as ‘root’ user

Step 2: Run the command “iptables -A INPUT -m iprange –src-range 192.168.2.1-192.168.2.9 -j ACCEPT” to whitelist IP range

Step 3: You must save the IPtables rules by running the command “service iptables save”

In the above example, you must change the IP address range in Step 2 with the IP range that you wish to allow.

Type the command “iptables -nL” to see the IPtables rules that you have added.

How to Create an Email Account on a cPanel Server

08 Oct, 17

How to Open / Allow range of ports on Linux

08 Oct, 17

Related Posts

Linux
Linux Server Administrstor

Leave a Reply Cancel reply

Search

Categories

Recent Posts

ping: command not found. How to install ping on...

03 Feb, 19

How to Suspend and unsuspend cPanel accounts

09 Jan, 19

Install Cassandra PHP extension

09 Jan, 19
Install PHP zookeeper extension from source

Install PHP zookeeper On CentOS from source

07 Jan, 19
Install PHP zookeeper extension

Install PHP zookeeper on CentOS Server

07 Jan, 19
Install PECL and phpize on Ubuntu

How to Install PECL and phpize on Ubuntu

06 Jan, 19

About Us

Globedrill.com is non-profit website established in April 2016.

Recent Posts

ping: command not found. How to install ping on...

03 Feb, 19

How to Suspend and unsuspend cPanel accounts

09 Jan, 19

Contact Us

GlobeDrill
Cochin Kerala
Pin - 682024
 
Email : info@globedrill.com
Sales : sales@globedrill.com

Globedrill

Copyright © 2016 Globedrill. All Rights Reserved. The content in this website is copyrighted to Globedrill.com and may not be republished either online or offline.

  • Contacts
  • About Us
  • Privacy Policy