How to Whitelist/Allow an IP address on CentOS, Redhat, Fedora Linux Server
Steps to Allow incoming and outgoing connection in IPtables Firewall is given below.
How to Whitelist/Allow Incoming connection from an IP address
- Login into your Linux server via SSH as ‘root’ user
- Run the command
iptables -A INPUT -s IPADDRESS -j ACCEPT
to whitelist/Allow the IP address
- Save the Iptables rule by running the command
service iptables save
- You must replace “IPADDRESS” in the Step 2 with the IP address you wish to whitelist.
How to Whitelist/Allow Outgoing connection to an IP address
- Login to the Linux server via SSH as ‘root’ user
- Run the command
iptables -A OUTPUT -d IPADDRESS -j ACCEPT
to whitelist Outgoing connections
- Run the command
service iptables save
to save the IPtables rules.
