From: Dmitri <dk-netfilter@nth.ca>
To: netfilter@lists.netfilter.org
Subject: Re: matching -d to a given interface without specifying ip address
Date: Thu, 07 Sep 2006 21:42:19 -0400 [thread overview]
Message-ID: <4500CA7B.6050304@nth.ca> (raw)
In-Reply-To: <edn2vt$4dl$1@sea.gmane.org>
Danny Rathjens wrote:
> Dmitri wrote:
>> The problem with specifying an IP is that it may change, which breaks
>> the rules and requires an update (and detection as well). Event for a
>> static IP, that's an extra dependency to watch out for.
>
> That's what variables in your firewall script are for.
> Just re-run it when your network connection restarts:
> EXTIF="eth0"
> EXTIP=`ifconfig $EXTIF |perl -ne'print $1 if /inet addr:([\d.]+)/'`
> iptables -A INPUT -j ACCEPT -i $EXTIF -p tcp -d $EXTIP --dport 80
Yes, but it's exactly the sort of hack I hoped to avoid. For a perfectly
simple expression, now I need to 1) detect that IP changed or connection
restarted, and 2) run the hack. There isn't supposed to be any firewall
script.
It's like SNAT vs. MASQUERADE - MASQUERADE works without any scripts or
reloads. Same can be done with other things which require reloading. The
less dynamic hacks in the system, the less of a nondeterministic mess it
would be.
Well, I guess the answer to my question is "no, there is no such
option". I'm half-considering implementing it myself, if I can find
heads and tails of it.
Thanks,
--Dmitri
next prev parent reply other threads:[~2006-09-08 1:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-02 22:32 matching -d to a given interface without specifying ip address Dmitri
2006-09-04 5:05 ` Rob Sterenborg
2006-09-05 4:42 ` Dmitri
2006-09-05 4:43 ` Rob Sterenborg
2006-09-08 2:03 ` Dmitri
2006-09-06 18:11 ` Danny Rathjens
2006-09-08 1:42 ` Dmitri [this message]
2006-09-08 9:44 ` Pascal Hambourg
2006-09-08 9:26 ` Pascal Hambourg
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=4500CA7B.6050304@nth.ca \
--to=dk-netfilter@nth.ca \
--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 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.