Created
November 3, 2021 16:27
-
-
Save tonmanna/1e12410d95cd44948582d780e8d5709d to your computer and use it in GitHub Desktop.
UFW Block firewall
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo ufw deny from {ip-address-here} to any | |
sudo ufw deny from 192.168.1.5 to any | |
sudo ufw reject from 202.54.5.7 to any | |
sudo ufw status | |
ufw deny from {ip-address-here} to any port {port-number-here} | |
sudo ufw deny from 202.54.1.5 to any port 80 | |
sudo ufw status numbered | |
sudo vi /etc/ufw/before.rules | |
# Block spammers | |
-A ufw-before-input -s 178.137.80.191 -j DROP | |
# Block ip/net (subnet) | |
-A ufw-before-input -s 202.54.1.0/24 -j DROP | |
ufw reload |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment