From: Grant Taylor <gtaylor@riverviewtech.net>
To: Mail List - Netfilter <netfilter@vger.kernel.org>
Subject: Re: Theoretical question: need for filter table in the POSTROUTING chain
Date: Thu, 25 Aug 2011 09:51:42 -0500 [thread overview]
Message-ID: <4E56617E.4040704@riverviewtech.net> (raw)
In-Reply-To: <4E5634C3.80908@freemail.hu>
On 08/25/11 06:40, Gáspár Lajos wrote:
> I would like to filter some destination IP-s both on the FORWARD and the
> OUTPUT chains... (For example to stop requests to private IP
> destinations leave our system.)
> I would like to use the REJECT target...
> It would be nince if there would be a filter table in the POSTROUTING
> chain...
>
> What do you think?
How about putting a reject route in the kernel routing table?
That will very easily prevent the packets from leaving your system.
Further, I think the kernel will (by default) send an ICMP packet
indicating that there is no route.
IPTables is great, but sometimes it's better to use a different technology.
Grant. . . .
P.S. Here's a series of commands that I run on my systems.
route add -net 0.0.0.0 netmask 255.0.0.0 reject
route add -net 10.0.0.0 netmask 255.0.0.0 reject
route add -net 169.254.0.0 netmask 255.255.0.0 reject
route add -net 172.16.0.0 netmask 255.240.0.0 reject
route add -net 192.0.2.0 netmask 255.255.255.0 reject
route add -net 192.168.0.0 netmask 255.255.0.0 reject
route add -net 198.51.100.0 netmask 255.255.255.0 reject
route add -net 203.0.113.0 netmask 255.255.255.0 reject
next prev parent reply other threads:[~2011-08-25 14:51 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-25 11:40 Theoretical question: need for filter table in the POSTROUTING chain Gáspár Lajos
2011-08-25 14:51 ` Grant Taylor [this message]
2011-08-25 15:30 ` Gáspár Lajos
2011-08-26 7:56 ` Jan Engelhardt
2011-08-26 9:13 ` Gáspár Lajos
2011-08-26 9:51 ` Jan Engelhardt
2011-08-26 21:16 ` Christian Benvenuti (benve)
2011-08-26 21:45 ` 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=4E56617E.4040704@riverviewtech.net \
--to=gtaylor@riverviewtech.net \
--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.