This article provides instructions on how to prevent unauthorized access to a Linux system by utilizing the ufw and firewalld tools. It explains the steps needed for both tools, including the necessary commands to deny connections from specific IP ranges and port numbers.

ufw

1
2
sudo ufw deny from <ip_range> port <port>

firewalld

1
2
sudo firewall-cmd --add-rich-rule='rule family="ipv4" source address="<ip_range>" port protocol="tcp" port="<port>" drop'

Comments