All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Wright <xktnniuymlla@mailinator.com>
To: Dan Purcell <dpurcell@nitrosecurity.com>
Cc: netfilter@lists.netfilter.org
Subject: Re: Specifying more than one IP address per rule
Date: Mon, 19 Mar 2007 14:52:44 -0800	[thread overview]
Message-ID: <45FF143C.9060307@mailinator.com> (raw)
In-Reply-To: <45FF093F.10301@nitrosecurity.com>

Dan Purcell wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Is there a way (such as an iptables match) that allows one to specify
> more than one IP address for one rule?  I have in mind something like
> the multiport patch -- allowing the user to specify multiple tcp / udp
> ports per rule.  For example, I have the following ruleset that I would
> like to convert into one rule:
> 
> iptables -N BADGUYS
> iptables -A BADGUYS -s 192.168.10.1    -j RETURN # 192.168.10.1 not bad
> iptables -A BADGUYS -s 192.168.10.0/24 -j DROP
> iptables -A BADGUYS -s 192.168.11.2    -j DROP
> iptables -A BADGUYS -s 192.168.11.3    -j DROP
> iptables -A BADGUYS -s 192.168.11.6    -j DROP
> 
> I would like something like
> 
> iptables -A BADGUYS -m multiip --srclist
> [!192.168.10.1,192.168.10.0/24,192.168.11.2,192.168.11.3,192.168.11.6]
> - -j DROP

I've had very good success using the ipset patch to iptables.  It allows 
you to use a single iptables rule to refer a named set of ips or nets, 
etc.  The set can then be updated on the fly without having to mess with 
your iptables rules.

hth, :m)


  reply	other threads:[~2007-03-19 22:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-03-19 22:05 Specifying more than one IP address per rule Dan Purcell
2007-03-19 22:52 ` Mike Wright [this message]
2007-03-19 22:55   ` Dan Purcell
2007-03-19 23:14     ` Mike Wright

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=45FF143C.9060307@mailinator.com \
    --to=xktnniuymlla@mailinator.com \
    --cc=dpurcell@nitrosecurity.com \
    --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.