This evening, I felt that the machine suddenly slowed down. I checked access. log and found an ip address (125.66.125.201) from Sichuan in the mainland China to access a file deleted eight hundred years ago.
So I downloaded ufw reject from 125.66.125.201 and loaded the ufw again. But the HTTP request is always filled in...
I had to run ufw status again to open all the rules and check whether the rule I just added was found.
Status: active
To Action From
------------
.............
80/tcp ALLOW Anywhere
Anywhere REJECT 125.66.125.201
It turns out that the rule that allows TCP 80 takes precedence over the blocked rule of the malicious ip address, so manually adjust the order to put the rule that blocks the malicious ip address first:
Sudo ufw insert 1 reject from 125.66.125.201
Close...
Slave? : Two blocking methods are available: reject and deny. reject directly ignores all packets. deny notifies the person who sends the packets: "His package is rejected." basically, just reject.
Update: Sometimes it is desirable to let the sender know when traffic is being denied, rather than simply ignoring it. In these cases, use reject instead of deny. from ufw man page
Here I wrote an error. I just flipped through the file again. It should be the reject that will let the sender know the rejection, while deny directly drops the packet. Row? Yuxi reject will let the client directly get "Connection refused", while deny will keep the program waiting until timeout.