[CentOS] Iptables rules not working

Thu Jul 16 15:54:04 UTC 2020
Alexander Dalloz <ad+lists at uni-x.org>

Am 16.07.2020 um 17:48 schrieb Kaushal Shriyan:
> Hi,
> 
> I am running CentOS Linux release 8.2.2004 (Core) on a remote server. I am
> running the below iptables command to allow SSH port 22 from a specific
> source IP 219.91.200.59
> 
> iptables -A INPUT -m tcp -p tcp -s 219.91.200.59 --dport 22 -j ACCEPT
>> service iptables save
> 
> 
> The above iptables ruleset is not working and I am still able to connect
> from the internet to SSH port 22. I look forward to hearing from you and
> thanks in advance.
> 
> Best Regards,
> 
> Kaushal

Please consult the documentation to understand how to use the firewall 
on CentOS 8:

https://access.redhat.com/documentation/en-us/red_hat_enterprise_linux/8/html-single/securing_networks/index#using-and-configuring-firewalld_securing-networks

In short: you are doing it wrong in multiple dimensions.

Alexander