All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hajes <david@hajes.org>
To: netfilter@vger.kernel.org
Subject: Re: Reload IPtables
Date: Sat, 26 Jun 2021 12:27:52 +0200	[thread overview]
Message-ID: <96559e16-e3a6-cefd-6183-1b47f31b9345@hajes.org> (raw)
In-Reply-To: <adc28927-724f-2cdb-ca6a-ff39be8de3ba@thelounge.net>


> sounds like a terrible mess with a ton of conditions which only works 
> with a simple ruleset

how many people do you know that use Linux with 10k lines in iptables?

slowest thing about loading iptables script was dealing with fail2ban 
that takes ages to load all banned IPs.

if guy asks how to reload properly ruleset - I doubt he has got any 
complex filtering on his machine ;-)

>
> it's not it's job to handle sysctl
>
> that belongs into a different file and running the iptables-script at 
> boot is a terrible idea because it's slow an non-atomic
>
> the only time when you should run a complex script is when you change 
> something and not at boot time where you simply restore the last state
>
> /usr/sbin/ipset -file /etc/sysconfig/ipset restore
> /usr/sbin/iptables-nft-restore /etc/sysconfig/iptables
> /usr/sbin/sysctl -q --load=/etc/sysctl*.conf
>
> that way first all rules are loaded atomic and *then* "ip_forward" and 
> friends are set to avoid a leak at boot

it may be good for you pro administrators with complex 
configurations...I have all in one file and do not need to bother about 
1ms lost during reload nor seeking 10 different config files for simple 
tasks and wasting hours by config. I like easy life.

My guess was that guy who asked doesn't have anything special and simple 
script resolves is terrible life trauma ;-)

Otherwise, he wouldn't ask such a question that is simple RTFM or UTFG ;-)

>
>> why would you reboot machine just because you need reload firewall?
>>
>> it seems to me that you need to learn basics of firewalling and Linux 
>> management.
>>
>> On 26/06/2021 01:47, slow_speed@att.net wrote:
>>> Yes, that was exactly my initial question.  I couldn't agree more.
>>>
>>> The issue was knowing the correct command to use force the reload. I 
>>> remain unclear on that if my files are in either 
>>> /etc/iptables.up.rules or /etc/iptables/rules.v4.
>>>
>>>
>>>
>>> On 6/25/21 7:43 PM, Reindl Harald wrote:
>>>>
>>>>
>>>> Am 25.06.21 um 23:30 schrieb slow_speed@att.net:
>>>>> I do not believe it is something one would use a script for. 
>>>>> Rather, there should be a way to reload the information into 
>>>>> memory without having to reboot.
>>>>
>>>> why would you ever reboot a linux system for something trivial than 
>>>> exchange, reset or realod iptables?
>>>>
>>>> * you have your ruleset
>>>> * you have saved it
>>>> * just load it
>>>>
>>>> "/usr/sbin/iptables-nft-restore /etc/sysconfig/iptables" or 
>>>> "iptables-restore" or "iptables-legacy-restore"
>>>>
>>>> there is no difference doing that at boot or any moment in time
>>>>
>>>>> On 6/25/21 4:51 PM, David Hajes wrote:
>>>>>> on Debian I flushed all tables including custom tables and used 
>>>>>> to run iptables bash script before I moved to nftables. OpenBSD 
>>>>>> same strategy - flush and reload pf.conf
>>>>>>
>>>>>> if that is what you mean by reload.
>>>>>>
>>>>>> On 25/06/2021 21:24, slow_speed@att.net wrote:
>>>>>>> What is the preferred command to reload the current rules for 
>>>>>>> iptables? (Please include Debian environment, if distro-specific.)

  reply	other threads:[~2021-06-26 10:27 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <08f069e3-914f-204a-dfd6-a56271ec1e55.ref@att.net>
2021-06-25 19:24 ` Reload IPtables slow_speed
2021-06-25 20:51   ` David Hajes
2021-06-25 21:30     ` slow_speed
2021-06-25 22:20       ` Stephen Satchell
     [not found]       ` <cd80bdd2-7816-f27f-d3fe-5042d213700e@satchell.net>
2021-06-25 22:37         ` slow_speed
2021-06-25 23:43       ` Reindl Harald
2021-06-25 23:47         ` slow_speed
2021-06-25 23:52           ` Reindl Harald
2021-06-26  7:19           ` David Hajes
2021-06-26 10:13             ` Reindl Harald
2021-06-26 10:27               ` David Hajes [this message]
2021-06-26 10:43                 ` Reindl Harald
2021-06-26 10:54                   ` David Hajes
2021-06-28  7:32                   ` Alessandro Vesely, Alessandro Vesely
2021-06-28  7:46                     ` Reindl Harald
2021-06-28  9:23                       ` Alessandro Vesely, Alessandro Vesely
2021-06-28  9:43                         ` Kerin Millar
2021-06-29  2:02                           ` Neal P. Murphy
2021-06-29  2:02                             ` Neal P. Murphy
     [not found]                             ` <20210629083652.GA10896@salvia>
2021-06-29  8:37                               ` Pablo Neira Ayuso
2021-07-01  1:49                                 ` Neal P. Murphy
2021-07-01  1:49                                   ` Neal P. Murphy
2021-06-29  9:10                             ` Kerin Millar
2021-06-29 14:52                             ` slow_speed
2021-06-29 15:18                               ` Reindl Harald
2021-06-29 16:50                                 ` slow_speed
2021-07-01  2:31                               ` Neal P. Murphy
2021-06-28 10:17                         ` Reindl Harald
2021-06-28 11:47                           ` Alessandro Vesely, Alessandro Vesely
2021-06-28 12:03                             ` Reindl Harald
2021-06-28 13:46                               ` Kerin Millar
2021-06-28 16:35                                 ` Reindl Harald
2021-06-28 17:10                                   ` Kerin Millar
2021-06-28 17:16                                     ` Reindl Harald
2021-06-28 17:35                               ` Alessandro Vesely, Alessandro Vesely
2021-06-28 18:15                                 ` Reindl Harald
2021-06-28 13:36                             ` Stephen Satchell
2021-06-27 14:56             ` slow_speed
2021-06-27 15:46               ` G.W. Haywood
2021-06-27 18:29               ` Stephen Satchell
2021-06-27 18:11           ` Kerin Millar
2021-06-27 18:32             ` slow_speed
2021-06-27 18:57               ` Reindl Harald
2021-06-27 20:57                 ` slow_speed
2021-06-27 21:33                   ` Reindl Harald
2021-06-27 19:07               ` Kerin Millar
2021-06-27 19:10                 ` Kerin Millar
2021-06-27 19:56                 ` Stephen Satchell
2021-06-27 20:12                   ` Kerin Millar
2021-06-27 20:20                     ` Reindl Harald
2021-06-27 19:43               ` Stephen Satchell

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=96559e16-e3a6-cefd-6183-1b47f31b9345@hajes.org \
    --to=david@hajes.org \
    --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 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.