Have you ever wondered how do the iptables whitelist IP?
IP whitelist is a security feature that limits and controls access only to trusted users. We can easily whitelist IP addresses using iptables.
At Bobcares, we often receive requests to whitelist IP addresses as part of our Server Management Services.
Today, let’s check how iptables whitelist IP addresses effectively.
IP whitelisting
IP whitelisting helps to have secure access to our data.
Usually, it allows us to create lists of trusted IP addresses or IP ranges from which users can access our domain.
The whitelist contains the approved IP addresses. Therefore, whitelisting makes the cybersecurity relatively easy.
Thus, Iptables, the common used firewall for Linux systems enable flexible IP whitelisting.
How do iptables whitelist IP?
As we have already said, IP whitelisting is a default-deny approach. And, It provides access permissions to some IP addresses.
Usually, iptables use the ACCEPT command for whitelisting IP’s. So, let’s now see how our Support Engineers whitelist IP addresses for customers.
Usually, we use the following command to whitelist a specified IP address.
iptables -A INPUT -s <specified_ip> -j ACCEPT
For instance, if we want to whitelist the IP address 1xx.1xx.x.1:
Firstly, we log in to the server via SSH. And, then allow incoming connections from 1xx.1xx.x.1 using the command,
iptables -A INPUT -s 1xx.1xx.x.1 -j ACCEPT
Also, the command to allow outgoing connections to 1xx.1xx.x.1 is,
iptables -A OUTPUT -d 1xx.1xx.x.1 -j ACCEPT
Recently, one of our customers approached us to whitelist IP. He wished to whitelist a few IP addresses ranging from 1xx.1xx.x.3x-5x.
Our Support Engineers used the ‘iprange’ to whitelist a range of IP’s.
iptables -A INPUT -m iprange --src-range 1xx.1xx.x.3x-5x -j ACCEPT
This will whitelist the IP addresses ranging from 1xx.1xx.x.3x-1xx.1xx.x.5x
[Need more assistance to whitelist IP addresses?- We’re available 24/7 to help you.]
Conclusion
In short, iptables whitelist IP addresses and give permission to specified IP addresses. Today’s writeup discussed more IP whitelisting using iptables and saw how our Support Engineers do it easily for our customers.
0 Comments