ufw
1 | sudo ufw deny from <ip_range> port <port> |
firewalld
1 | sudo firewall-cmd --add-rich-rule='rule family="ipv4" source address="<ip_range>" port protocol="tcp" port="<port>" drop' |
ufw
1 | sudo ufw deny from <ip_range> port <port> |
firewalld
1 | sudo firewall-cmd --add-rich-rule='rule family="ipv4" source address="<ip_range>" port protocol="tcp" port="<port>" drop' |
when using long range public wifi it matters to block every port from incoming connections.
1 | sudo ufw default deny |
when configuration is done, remember to restart ufw and reconnect existing interfaces.
although remote clients are blocked, self-issued connections are not. so be sure to use another computer for testing ufw effectiveness before and after configuration.