From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5B7ECC2BA1A for ; Sat, 25 Apr 2020 03:07:36 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0EF6920714 for ; Sat, 25 Apr 2020 03:07:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0EF6920714 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies-bounces@kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.92.3) (envelope-from ) id 1jSB9l-0000iW-9g; Fri, 24 Apr 2020 23:07:05 -0400 Received: from omr2.cc.ipv6.vt.edu ([2607:b400:92:8400:0:33:fb76:806e] helo=omr2.cc.vt.edu) by shelob.surriel.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92.3) (envelope-from ) id 1jSB9j-0000iO-Fn for kernelnewbies@kernelnewbies.org; Fri, 24 Apr 2020 23:07:03 -0400 Received: from mr3.cc.vt.edu (mr3.cc.ipv6.vt.edu [IPv6:2607:b400:92:8500:0:7f:b804:6b0a]) by omr2.cc.vt.edu (8.14.4/8.14.4) with ESMTP id 03P372Ss030123 for ; Fri, 24 Apr 2020 23:07:02 -0400 Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by mr3.cc.vt.edu (8.14.7/8.14.7) with ESMTP id 03P36u3w032214 for ; Fri, 24 Apr 2020 23:07:01 -0400 Received: by mail-qt1-f198.google.com with SMTP id x24so13422193qta.4 for ; Fri, 24 Apr 2020 20:07:01 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=i8twNu0MJrg3hHJXHeb7zZ97wWt7o3mYhbZlkGQBFRE=; b=gTPMmlxyWKTGrp+N+b74UdeqBBbHM/JVgYB8GNAmxGyrHVATo0i9ColGWHQRhlkBZN 1MEHOJZoBW4feSiJB27YESRFOjWPKCLzTqz4Yl+/t5NcGl2TCbFBxCfP1WQ1vmdCJ3Wv RbRmGsuYk4qQf0SEEFHvEN8AKJEtYkWCYv8WjbsOePy1mQhD+2hEpR4uYr9z8r8pMxrU GdrTNmc+PX/RPFWqUjrxQYaW7gbZwxpf8HBJFgdNrkjqfF2Vy5w/SbJ6ENLaC1p/MS9M +bn7iyGVpEmDIB1MaSqquhvtJVXaoY9xXuKmJK6gseufLLmjvXeTKdT/+Oe4K+HETfJQ 03xg== X-Gm-Message-State: AGi0PuaF8cDQ1XXtRg6iScM8vyRYhHAGDiHFiA+FcoHOpUApdxRdbo4Z YjZAPImpZcDIne7yKliBTDxzi9ruzGolEwsSQJ8X0TEji2oOpFRQs/BIrVI8u0BB2Cxs4XlstYm 1h4lBScd8uqd6cYwuJJqVC92qb5Tqs9bFWOnTJk0= X-Received: by 2002:a37:9e08:: with SMTP id h8mr12637310qke.369.1587784016671; Fri, 24 Apr 2020 20:06:56 -0700 (PDT) X-Google-Smtp-Source: APiQypJ4iDW7n8RVTCJVOrLaupJyd2AGqEocejrxGDSlhUPFMTBgdt4HdoLEVFcPDfb17GXbjKez2A== X-Received: by 2002:a37:9e08:: with SMTP id h8mr12637288qke.369.1587784016361; Fri, 24 Apr 2020 20:06:56 -0700 (PDT) Received: from turing-police ([2601:5c0:c001:c9e1::359]) by smtp.gmail.com with ESMTPSA id p24sm5581859qtp.59.2020.04.24.20.06.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 24 Apr 2020 20:06:54 -0700 (PDT) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.9.0 11/07/2018 with nmh-1.7+dev To: noloader@gmail.com Subject: Re: iptables and combining additional rule sources In-Reply-To: References: Mime-Version: 1.0 Date: Fri, 24 Apr 2020 23:06:54 -0400 Message-ID: <40076.1587784014@turing-police> Cc: kernelnewbies X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============5712885812192864825==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============5712885812192864825== Content-Type: multipart/signed; boundary="==_Exmh_1587784013_5783P"; micalg=pgp-sha1; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1587784013_5783P Content-Type: text/plain; charset=us-ascii 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. --==_Exmh_1587784013_5783P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQIVAwUBXqOpTQdmEQWDXROgAQIn9w/9HDObGyESjmwzMNanvKww15JBWZc0iYBV 6dSodc5qaGGeH5zfkPqM8Vo06Wia99lZJzLgR1PDKKQSzAW95ZpkVhDSVV2XdkDY kM0eIDdskSjNDWMJWJV82AjOBDQJEp1I31OjpWIre8smDMmFdAQPhTIY79AerD0m 5fxjFxExYzMeIcvpKiN9a/OK/d7zIAOIJcZzGkkgs03qF7TJhDJ0AoxprRvdZdGc kcvctAgEB28mbY8z6VUZ/0SfiLjKHXndPIAAUDsfAg0FS8y5M0ZoO0DSWZEXfY5E xEn6JlTnEenGZG4AsuOoQTrYUyXKr2dcmxDBtlWdsQOCfR0hWPAz8otDURLxvth0 FToBOssj4FrPJ+J6pAVZFfyNsBoRE9y4QJLjC16tPClOm712gzun+mfTtitYMy9k y2UnvYl4AbPUXACl+CDAUBUL4cD6eljQPnvINEmxY1fIX9oYw6CKT/BglPWwn8T7 4epU+h2JQKE7T7xfkfISI1MWCLKNj+KwRen+N/yotHP8YPIqnE8QIDyCyekejRuK H5qlWEoX8w2cxs6ynj5OVLUx4Lijx3ZuIS49dZQXHI6rAIm/CeXYm1ROqrrhZ1vK xYoO0RkdPXn/c3nIUtm8Gea/Aqd1R+7MWvDCck4wkGDPCqgION0oLPnlym1rQOqH gjPzHx7d95U= =C1sq -----END PGP SIGNATURE----- --==_Exmh_1587784013_5783P-- --===============5712885812192864825== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============5712885812192864825==--