All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michal Kubeček" <mkubecek@suse.cz>
To: netfilter@vger.kernel.org
Subject: Re: iptables port redirect question
Date: Mon, 17 Sep 2012 08:12:23 +0200	[thread overview]
Message-ID: <3980014.EOsJlpYLpK@alaris> (raw)
In-Reply-To: <20120917110300.5e546d0c@shiva.selfip.org>

On Monday 17 of September 2012 11:03EN, joydeep@infoservices.in wrote:
> Hello,
> 
> How can I redirect all packets exclude the packets for lan (
> 192.168.0.0 ) and all packets to/from lo (localhost) ?
...
> But this also redirect all local lan packets naturally, as it compares
> with lo . How can I combined both lo and local lan ? Can a customized
> chain help ?

Yes, in general, custom chain and RETURN target can help to simulate 
"or" operator. But in your case, you should be able to combine "! -o lo" 
and "! -d 192.168.0.0/16" matches to do what you need.

On the other hand, I prefer to explicitly state what I want to 
masquerade rather than masqeurading everything with some exceptions.

                                                          Michal Kubeèek


  reply	other threads:[~2012-09-17  6:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-17  5:33 iptables port redirect question joydeep
2012-09-17  6:12 ` Michal Kubeček [this message]
2012-09-17  7:17   ` joydeep.bakshi
2012-09-17  7:31     ` Jan Engelhardt

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=3980014.EOsJlpYLpK@alaris \
    --to=mkubecek@suse.cz \
    --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.