How to block a specific IP Address using UFW
How to block a specific IP Address using UFW
| To                         Action      From | 
| --                         ------      ---- | 
| 22                         ALLOW       Anywhere | 
| 80                         ALLOW       Anywhere | 
| 443                        ALLOW       Anywhere | 
| 22                         ALLOW       Anywhere (v6) | 
| 80                         ALLOW       Anywhere (v6) | 
| 443                        ALLOW       Anywhere (v6) | 
Therefore, to block an IP address the rules would need to setup like this:
| To                         Action      From | 
| --                         ------      ---- | 
| Anywhere                   DENY        <ip address > | 
| 22                         ALLOW       Anywhere | 
| 80                         ALLOW       Anywhere | 
| 443                        ALLOW       Anywhere | 
| 22                         ALLOW       Anywhere (v6) | 
| 80                         ALLOW       Anywhere (v6) | 
| 443                        ALLOW       Anywhere (v6) | 
To do this you need to insert the new deny rule at the top using the “insert” option.
| sudo ufw insert 1 deny from <ip address> | 
To remove the block simple:
| sudo ufw delete allow from <ip address> | 
For more information read the community documentation for UFW on Ubuntu.
欢迎转载,转载请保留页面地址。帮助到你的请点个推荐。

 
                
            
         
         浙公网安备 33010602011771号
浙公网安备 33010602011771号