3

I have an apache2.4 webserver, and I am trying to block a malicious subnet using ufw. Here is the UFW setup:

$ sudo ufw status verbose
Status: active
Logging: on (low)
Default: deny (incoming), allow (outgoing)
New profiles: skip

To                         Action      From
--                         ------      ----
80                         ALLOW IN    Anywhere
Anywhere                   DENY IN     X.X.X.0/24

I to test, I added a rule to block my own IP but I can still view the pages, and site, so evidently, UFW is not blocking traffic from my IP. I can only assume the case is the same for the blocked subnet.

Please, how can I block subnets from accessing my webpages?

1

1 Answer 1

3

(If you're running apache server at port 80). UFW parses the rule in sequential manner, so when the rule matches i.e you allow anyone from anywhere to access your 80 port, as the match is found, you're packet is accepted. It follows the first-match policy.

So now try again and configure it, if problem persist, write a comment below . !

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .