From: Reindl Harald <h.reindl@thelounge.net>
To: Jags <TheJags@protonmail.com>, zrm <zrm@trustiosity.com>
Cc: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: How can I block all traffic from an IP range, irrespective of origin, going to, or coming from, using nftables in Debian 10
Date: Fri, 4 Oct 2019 12:18:04 +0200 [thread overview]
Message-ID: <de499a93-2306-a681-6e2a-2c227250f8f3@thelounge.net> (raw)
In-Reply-To: <caAb8jKSxb6sL49NLsEuMiqcr87ZCzfsFPLGnHT1VkqjcyKkf-fBozz-gcVljJRRoeyTolYe-Ou2H2P8BrIS7l--UXO18hA-4499YWMajtw=@protonmail.com>
Am 04.10.19 um 11:45 schrieb Jags:
> @zrm thank you so much for the reply.
>
>
> (1) Would it be something like this:
>
> :::::
> chain output {
> type filter hook output priority 0; policy accept;
>
> ip daddr 123.0.0.0/8 ct state established,related,new,invalid,untracked counter reject
> }
> :::::
>
> Because just last night I tried that, but I could still see IPs from the blocked range. Or am I missing something here.
>
> Note: In this OUTPUT chain, if I change: "policy accept" to "policy drop", I lose the internet completely.
>
>
> (2) In addition to the OUTPUT chain, I've added this into INPUT chain too:
>
> :::::
> chain input {
> type filter hook input priority 0; policy drop;
>
> ip saddr 123.0.0.0/8 ct state established,related,new,invalid,untracked counter drop
> }
> :::::
>
>
> So how should I modify the either or both of the above please... many thanks
it's the same as with iptables
"established,related" allows responses and so when your client made a
connection to a peer data from this peer is allowed back
order matters and there is no point to change the outbound policy to DROP
the policy is applied after all rules and the first mathcing action
wins, everywhere
next prev parent reply other threads:[~2019-10-04 10:18 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-10-01 23:22 How can I block all traffic from an IP range, irrespective of origin, going to, or coming from, using nftables in Debian 10 Jags
2019-10-03 19:00 ` zrm
2019-10-04 9:45 ` Jags
2019-10-04 10:18 ` Reindl Harald [this message]
2019-10-04 10:44 ` Jags
2019-10-04 11:05 ` Reindl Harald
2019-10-04 12:21 ` Jags
2019-10-04 13:06 ` Reindl Harald
2019-10-04 14:28 ` Jags
2019-10-04 15:10 ` Reindl Harald
2019-10-04 15:47 ` Neal P. Murphy
2019-10-04 16:25 ` Jags
2019-10-04 20:30 ` Anton Rieger
2019-10-04 21:27 ` Jags
2019-10-06 17:26 ` sean darcy
2019-10-06 23:00 ` Jags
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=de499a93-2306-a681-6e2a-2c227250f8f3@thelounge.net \
--to=h.reindl@thelounge.net \
--cc=TheJags@protonmail.com \
--cc=netfilter@vger.kernel.org \
--cc=zrm@trustiosity.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.