From: Duncan Roe <duncan_roe@optusnet.com.au>
To: "netfilter@vger.kernel.org" <netfilter@vger.kernel.org>
Subject: Re: Is it possible to change a chains default policy when rules are already present?
Date: Thu, 13 Aug 2020 23:38:53 +1000 [thread overview]
Message-ID: <20200813133853.GA19665@smallstar.local.net> (raw)
In-Reply-To: <AM0PR06MB4628EC9ADC47B01F8B6DFDB1C5430@AM0PR06MB4628.eurprd06.prod.outlook.com>
On Thu, Aug 13, 2020 at 12:50:54PM +0000, Andreas Hoefler wrote:
> Hi
>
> Thx for the quick reply. Forgot to mention I am using NFTables...but I guess this should be then possible as well.
>
> Thx
> Andy
>
> Am 13.08.20 um 14:28 schrieb Andreas Hoefler:
> > I have a chain with default policy drop.
> > I would like to first have the default policy set to accept, then add rules and later change it to drop.
> > Is this possible?
>
> iptables -t <table> -P <CHAIN> ACCEPT
> iptables -t <table> -P <CHAIN> DROP
Hi Andy,
If you are using individual nft commands then yes, you can do that.
But there is no need to do it if using an nft script (#!/usr/sbin/nft -f), since
nothing is sent to the kernel until the script is all done, and then the kernel
makes all the changes atomically (i.e. all processes are locked out until all
the changes are done).
Cheers ... Duncan.
next prev parent reply other threads:[~2020-08-13 13:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-13 12:28 Is it possible to change a chains default policy when rules are already present? Andreas Hoefler
2020-08-13 12:48 ` Reindl Harald
2020-08-13 12:50 ` Andreas Hoefler
2020-08-13 13:38 ` Duncan Roe [this message]
2020-08-14 11:07 ` Pablo Neira Ayuso
2020-08-14 11:21 ` Daniel
2020-08-14 11:36 ` Reindl Harald
2020-08-14 12:54 ` Daniel
2020-08-14 13:08 ` Florian Westphal
2020-08-14 13:21 ` Andreas Hoefler
2020-08-14 13:40 ` Florian Westphal
2020-08-14 13:44 ` Andreas Hoefler
2020-08-14 15:31 ` Daniel
2020-08-14 14:37 ` Pablo Neira Ayuso
2020-08-14 11:43 ` Andreas Hoefler
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=20200813133853.GA19665@smallstar.local.net \
--to=duncan_roe@optusnet.com.au \
--cc=netfilter@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox