Firewall broken on 20.04?

linux_forum1 linux_forum1 at protonmail.com
Fri Jan 7 02:07:30 UTC 2022


Hello! I would like to log and drop when one of these iptable rules gets matched but it doesn't work.
(It's 30 - 40 rules in total)

-p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
--s 169.254.0.0/16 -j DROP
-s 172.16.0.0/12 -j DROP
-s 192.0.2.0/24 -j DROP

This is my solution:

-N Block
-N Logger
-A INPUT -j Block
-A FORWARD -j Block

-A Block -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j Logger
-A Block -s 169.254.0.0/16 -j Logger
-A Block -s 172.16.0.0/12 -j Logger
-A Block -s 192.0.2.0/24 -j Logger

-A Logger -j LOG --log-level 4
-A Logger -j DROP

Solution 2:
(This was recommended against)
-N Block
-A INPUT -j Block
-A FORWARD -j Block

-A Block -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j LOG
-A Block -p tcp -m tcp --tcp-flags SYN,RST SYN,RST -j DROP
-A Block -s 169.254.0.0/16 -j LOG
-A Block -s 169.254.0.0/16 -j DROP
-A Block -s 172.16.0.0/12 -j LOG
-A Block -s 172.16.0.0/12 -j DROP
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20220107/b325abe2/attachment.html>


More information about the ubuntu-users mailing list