kernelnewbies.kernelnewbies.org archive mirror
 help / color / mirror / Atom feed
From: "Valdis Klētnieks" <valdis.kletnieks@vt.edu>
To: noloader@gmail.com
Cc: kernelnewbies <kernelnewbies@kernelnewbies.org>
Subject: Re: iptables and combining additional rule sources
Date: Fri, 24 Apr 2020 23:06:54 -0400	[thread overview]
Message-ID: <40076.1587784014@turing-police> (raw)
In-Reply-To: <CAH8yC8kqc=HUGs=nUbe52anfT24CGyS0VypCpuqNZNPb6gcB6g@mail.gmail.com>


[-- Attachment #1.1: Type: text/plain, Size: 888 bytes --]

On Fri, 24 Apr 2020 18:28:21 -0400, Jeffrey Walton said:

> The problem I am having is, adding the new information to the existing
> iptables rules in /etc/sysconfig/iptables. I want to write my rules to
> a separate file and then tell /etc/sysconfig/iptables to include it at
> the correct position.
>
> I read the iptables(8), iptables-save(8) and iptables-restore(8) man
> pages, but I don't see how to combine the different sources.
>
> How do I tell iptables to include a second external source at a
> specific location?

Turn the problem on its side....

#!/bin/bash
cat /etc/iptables.header /etc/iptables.newstuff /etc/iptables.trailer > /etc/sysconfig/iptables
iptables-restore < /etc/sysconfig/iptables

(basically the solution I did for an NFS server, where 'newstuff' and /etc/exports were
both machine-generated by a perl script that read a config file of authorized clients.

[-- Attachment #1.2: Type: application/pgp-signature, Size: 832 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

  reply	other threads:[~2020-04-25  3:07 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-24 22:28 iptables and combining additional rule sources Jeffrey Walton
2020-04-25  3:06 ` Valdis Klētnieks [this message]
2020-04-25  6:55   ` Jeffrey Walton
2020-04-25 16:53     ` Valdis Klētnieks
2020-04-25 17:16       ` Jeffrey Walton
2020-04-25  3:32 ` Keh-Ming Luoh
2020-04-25  7:01   ` Jeffrey Walton
2020-04-26 12:42 ` Aruna Hewapathirane
2020-04-29  9:30 ` Thorondir

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=40076.1587784014@turing-police \
    --to=valdis.kletnieks@vt.edu \
    --cc=kernelnewbies@kernelnewbies.org \
    --cc=noloader@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).