Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Petrisor Bobalca <petry.b@gmail.com>
To: netfilter@lists.netfilter.org
Subject: Re: Adding variables to iptables file
Date: Tue, 8 Mar 2005 14:56:25 +0200	[thread overview]
Message-ID: <577345615.20050308145625@gmail.com> (raw)
In-Reply-To: <!~!UENERkVCMDkAAQACAAAAAAAAAAAAAAAAABgAAAAAAAAAQrQTl2OGOEWpZSe7NzzKncKAAAAQAAAAc3JzitFkUE6dTyLL0qVAQQEAAAAA@bigpond.net.au>

Hello,

iptables-save and iptables-restore don't work with variables. for
example if run the script:

-------------
#!/bin/bash
ext_if="eth0"
ipt="/usr/sbin/iptables"

$ipt -A INPUT -i $ext_if -j DROP
-------------

iptables-save will output:

-------------
#Generated by .....
*filter
:INPUT ACCEPT
:FORWARD ACCEPT
:OUTPUT ACCEPT
-A INPUT -i eth0 -j DROP
COMMIT
#Completed...
-------------

so, if you really need variables use a script!


On Tuesday, March 8, 2005, 12:25:36 PM, Veena Etcell wrote:

> Hi,

> I am hoping someone can help with the following:
> I am at a point where I require advice/direction with regards to adding
> variables (manually or otherwise) to a standard iptables file.
> I am not sure how to add them/where to add them or the syntax that is
> required.

> In the example below I have manually added one variable (Line 2) to see
> would happen to /etc/sysconfig/iptables (Redhat FC3 install).

> When I iptables-restore < /etc/sysconfig/iptables I get "error at line 2
> failed"


> # Generated by iptables-save v1.2.11 on Mon Mar  7 22:18:56 2005
> EXT_INTERFACE="eth0"
> *filter
> :INPUT ACCEPT [0:0]
> :FORWARD ACCEPT [0:0]
> :OUTPUT ACCEPT [0:0]
> -A INPUT -p tcp -j REJECT --reject-with icmp-port-unreachable 
> -A INPUT -p udp -j REJECT --reject-with icmp-port-unreachable 
> -A INPUT -i lo -j ACCEPT 
> -A OUTPUT -o lo -j ACCEPT 
> -A mine -j ACCEPT 
> COMMIT
> # Completed on Mon Mar  7 22:18:56 2005

> Any advice would be appreciated
> Thanks and regards
> michael


-- 
Best regards,
 Petrisor                            mailto:petry.b@gmail.com



  parent reply	other threads:[~2005-03-08 12:56 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-03-08 10:25 Adding variables to iptables file Veena Etcell
2005-03-08 12:09 ` richard hauswald
2005-03-08 12:56 ` Petrisor Bobalca [this message]
     [not found] <Pine.LNX.4.60.0503080528530.2382@darkstar.sysinfo.com>
2005-03-08 10:36 ` Veena Etcell
2005-03-08 22:18   ` John A. Sullivan III
2005-03-08 22:50     ` Dimitri Yioulos
2005-03-09  1:37       ` Jason Opperisano
  -- strict thread matches above, loose matches on Subject: below --
2005-03-09 15:43 Dimitri Yioulos

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=577345615.20050308145625@gmail.com \
    --to=petry.b@gmail.com \
    --cc=netfilter@lists.netfilter.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