All of lore.kernel.org
 help / color / mirror / Atom feed
From: Pascal Hambourg <pascal@plouf.fr.eu.org>
To: Netfilter Users Mailing list <netfilter@vger.kernel.org>
Subject: Re: iptables Qu: how to specify !dst:port
Date: Fri, 12 Jul 2013 15:00:44 +0200	[thread overview]
Message-ID: <51DFFDFC.1060204@plouf.fr.eu.org> (raw)
In-Reply-To: <CAOkSjBhV9YE=hrX4+OcF++F_dDvtRZVd94sSP=4m-rynPZJ6gQ@mail.gmail.com>

Hello,

Arturo Borrero Gonzalez a écrit :
> 2013/7/12 Die Optimisten <inform@die-optimisten.net>:
>>
>> How can I write -t nat
>>     [all except these 2:]    (! -d 127.0.0.1 -and  ! -d  192.168.0.0/16)  ?
> 
> I would do it with ipset(8).

ipset is overkill for just a couple of prefixes.

iptables -t nat -A PREROUTING -d 192.168.0.0/16 -p tcp --dport 443 \
  -j RETURN
iptables -t nat -A PREROUTING ! -d 127.0.0.1 -p tcp --dport 443 \
  -j DNAT --to 127.0.0.1:8000

  reply	other threads:[~2013-07-12 13:00 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-12 12:00 iptables Qu: how to specify !dst:port Die Optimisten
2013-07-12 12:10 ` Arturo Borrero Gonzalez
2013-07-12 12:31   ` Die Optimisten
2013-07-12 12:50     ` Arturo Borrero Gonzalez
2013-07-12 13:00       ` Pascal Hambourg [this message]
2013-07-12 16:09       ` Die Optimisten

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=51DFFDFC.1060204@plouf.fr.eu.org \
    --to=pascal@plouf.fr.eu.org \
    --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.