netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lars Nooden <lars.curator@gmail.com>
To: Florian Effenberger <floeff@gmail.com>
Cc: netfilter@vger.kernel.org
Subject: Re: randomly changing IPs from different subnets (Google Mail)
Date: Wed, 23 Jun 2010 14:52:12 +0300	[thread overview]
Message-ID: <4C21F56C.3070603@gmail.com> (raw)
In-Reply-To: <DC83A9D5-A181-42B0-9FED-13EB46F2D24A@gmail.com>

On 22.06.2010 um 11:53 schreib Florian Effenberger:
> Hi Lars,
>
> Am 22.06.2010 um 21:16 schrieb Lars Nooden:
>
> the same Lars Nooden as from the OOo mailing lists? If so: It's a
> small world. ;-)

Yes.  Hello again.

>> The chain is a drop-through list of ip addresses that you have
>> decided are good.  Then make a rule or pair of rules to send tcp
>> traffic for port 993 and port 537 to that user-defined chain.
>
> If I run a script every 60 seconds per cron and add the hostname, it
> will automatically add all IPs returned by the DNS at that time.
> However, this changes randomly, and change time is not predictable.

As others mentioned, it is probably a round-robin algorithm for a small 
pool of ip addresses.  Google might even tell you which ones or you can 
keep polling.

Once you acquire a list of the allowed destination ip numbers, the 
hostnames probably don't need to get polled more frequently than the ttl 
for the main dns record.  If you work with the ip addresses, rather than 
the hostnames that need for look-up is minimized.

> If I add ten times the host and it resolves to the same IP, iptables
> doesn't recognize that, and I have 10 similar rules. Is there any
> check for duplicates possible?

AFAIK, not inherently in iptables itself, but if you make a separate 
chain, it is easier to work on it via grep and sort.   Use 'iptables 
-nL' or 'iptables-save' and send the output to grep, looking for the ip 
number in question, if it is not present, add it.   That's simple shell 
scripting.

/Lars



  parent reply	other threads:[~2010-06-23 11:52 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-22 18:16 randomly changing IPs from different subnets (Google Mail) Florian Effenberger
2010-06-22 18:19 ` Jan Engelhardt
2010-06-22 18:30   ` Florian Effenberger
2010-06-22 19:16     ` Lars Nooden
2010-06-23  8:53       ` Florian Effenberger
2010-06-23  9:33         ` Mart Frauenlob
2010-06-23 16:46           ` Florian Effenberger
2010-06-23 11:52         ` Lars Nooden [this message]
2010-06-23 11:54           ` Jan Engelhardt
2010-06-23 13:47             ` Lars Nooden
2010-06-23 13:52               ` John Haxby
2010-06-23 14:12               ` /dev/rob0
2010-06-23 14:36                 ` Documentation (was Re: randomly changing IPs from different subnets (Google Mail)) Lars Nooden
2010-06-23 15:13                   ` /dev/rob0
2010-06-23 16:00                     ` Jan Engelhardt
2010-06-23 16:15                       ` Lars Nooden
2010-06-23 16:36                         ` Jan Engelhardt
2010-06-23 18:34                           ` Grant Taylor
2010-06-23 18:41                             ` Jan Engelhardt
2010-06-23 18:53                               ` Grant Taylor
2010-06-24  6:17                     ` Andrew Beverley
2010-06-24 16:45                       ` Grant Taylor
2010-06-23 16:44           ` randomly changing IPs from different subnets (Google Mail) Florian Effenberger
2010-06-23 18:36           ` Grant Taylor
2010-06-22 19:18     ` Jan Engelhardt
2010-06-22 18:55 ` Jeff Largent
2010-06-23  1:09   ` /dev/rob0
2010-06-23  1:22     ` Mike Lay

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=4C21F56C.3070603@gmail.com \
    --to=lars.curator@gmail.com \
    --cc=floeff@gmail.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).