From: tlhackque <tlhackque@yahoo.com>
To: netfilter@vger.kernel.org
Subject: Odd use of netmasks - Supported?
Date: Thu, 04 Oct 2012 18:07:07 -0400 [thread overview]
Message-ID: <506E088B.8000203@yahoo.com> (raw)
I have some very long (thousands of rules) rule chains, which I wish to
shorten by dispatching on part of the address.
Clearly, I can do something like -A FOO -s 2001:db8:1000/36 -j SUBCHAIN-81.
But in IPV6, the high order bits really aren't interesting.
The syntax -A FOO -s 001:c000::0/0f:f000:: (note the leading 1s in the
"netmask") seems to be accepted by iptables, and the rule appears with -L.
I would expect an address to be XORed with the -s address, ANDed with
the mask, and be true if 0. Even though this is an illegal mask for
routing, it's interesting for this.
Rather than experiment and rely on some undocumented behavior, I thought
I should ask:
Is this usage supported (in the sense that it will behave as described
and will continue to do so)? Or is this living dangerously?
Of course, it would be nice to have a chain type that didn't have
sequential evaluation semantics and just dispatched based on netmask and
address... but that's how things might be, not how they are...
(Why ridiculous chain lengths, you ask? Country blocking. But no
philosophical discussions about why this is a bad idea/easy to subvert,
please.)
Thanks.
--
---------------------------------------------------------
This communication may not represent my employer's views,
if any, on the matters discussed.
next reply other threads:[~2012-10-04 22:07 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-04 22:07 tlhackque [this message]
2012-10-04 23:41 ` Odd use of netmasks - Supported? Jan Engelhardt
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=506E088B.8000203@yahoo.com \
--to=tlhackque@yahoo.com \
--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.