Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Joel Newkirk <netfilter@newkirk.us>
To: seberino@spawar.navy.mil, Steve Mickeler <steve@warning.ca>
Cc: netfilter@lists.netfilter.org
Subject: Re: How filter IP address if it *changes* often?? (think dhcp)
Date: Fri, 28 Mar 2003 10:11:36 -0500	[thread overview]
Message-ID: <200303281011.36468.netfilter@newkirk.us> (raw)
In-Reply-To: <20030327222617.A19911@spawar.navy.mil>

On Friday 28 March 2003 01:26 am, seberino@spawar.navy.mil wrote:
> Steve
>
> Thanks for the email.  Let me rerephrase my question.
> Perhaps I wasn't clear....
>
> How can you have a rule on your INPUT chain that
> only allows your local box's IP address if "local box IP address" can
> change without notice due to your DSL ISP's decision?

Have a cron job that compares the output from ifconfig for the given 
interface with the output from "iptables -n -L INPUT".  If they differ, 
then the job can delete the current rule and insert a new one.

I wrote something similar for my system to adapt to a slow-changing IP on 
my DSL and update my SNAT rule and a text file with the new IP.

It's unusual, however, to actually need to use your own IP in the INPUT 
chain, as the only destination IP's that should appear there are those 
of the box itself, either public (internet) private (lan) or localhost 
(127.0.0.1 typically) and those three situations can usually be 
determined by matching interface instead of IP.  Normally the only time 
you'd need to match the IP in INPUT from the internet is when you have 
multiple public IP's, and usually in such cases they are static.  (but 
not always, granted)

j



  parent reply	other threads:[~2003-03-28 15:11 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-28  4:00 How filter IP address if it *changes* often?? (think dhcp) seberino
2001-03-28 16:51 ` Rowan Reid
2003-03-28  4:16 ` Steve Mickeler
2003-03-28  6:26   ` seberino
2003-03-28  8:15     ` Michael K
2003-03-28  9:31     ` Kim Jensen
2003-03-28 15:11     ` Joel Newkirk [this message]
  -- strict thread matches above, loose matches on Subject: below --
2003-03-28 19:06 Tomasz Korycki

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=200303281011.36468.netfilter@newkirk.us \
    --to=netfilter@newkirk.us \
    --cc=netfilter@lists.netfilter.org \
    --cc=seberino@spawar.navy.mil \
    --cc=steve@warning.ca \
    /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