From: "Simo Hakanen" <simo.hakanen@no.phnet.spam.fi>
To: netfilter@lists.netfilter.org
Subject: iptables-save and iptables-restore problem with long rules
Date: Fri, 31 Oct 2003 00:25:59 +0200 [thread overview]
Message-ID: <000001c39f34$cb72a5b0$0800a8c0@Melissa> (raw)
Hi.
Simply:
iptables-save -c > $IPTABLES_CONFIG -line used in
the init-script of rh9 does not export the rules properly.
It does a random truncation of lines and leaves out the " and ' -marks.
I don't know whether this is a bug but let me explain a bit detail.
I used fwbuilder 1.0.11-1 to build my fw rules for
my gateway. I use ulogd for logging so I choosed the
option and left the default logging-prefix as it was.
I was able to commit those rules to iptables with no problems.
I noticed the problem when I were transporting
the init-script of iptables from rh to suse (Personnally I don't like
SuSEFirewall2 wrapping).
The save-function works fine but when I try to restore the rules from
the file, they are not accepted by iptables.
Some lines in the file have been truncated even though some other lines that are
longer as still intact.
For example, rule like:
iptables -A INPUT -s xxx.xxx.xxx.xxx/24 -d xxx.xxx.xxx.xxx/32 -p tcp -m state --state NEW -j ULOG --ulog-prefix "RULE 0
-- LOG " --ulog-nlgroup 32 --ulog-qthreshold 20
will be stored as (hopefully the linefeeds are in place)
[0:0] -A INPUT -s 192.168.0.0/255.255.255.0 -d 192.168.0.2 -p tcp -m state --state NEW -j ULOG --ulog-prefix RULE 0 --
LOG --ulog-nlgroup 32
--ulog-qthreshold 20
The last part, --ulog-qthreshold 20 in on the next line so
iptables-restore thinks it as a new rule and fails. Also notice
that there are no "-marks around the --log-prefix so iptables-restore
also fails to read that part (Bad argument `0').
It seemed that the --ulog-qthreshold part was always the one put on another line.
Hopefully you can make something out of this.
---
Simo Hakanen
reply other threads:[~2003-10-30 22:25 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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='000001c39f34$cb72a5b0$0800a8c0@Melissa' \
--to=simo.hakanen@no.phnet.spam.fi \
--cc=netfilter@lists.netfilter.org \
--cc=simo.hakanen@phnet.fi \
/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