From: "Gáspár Lajos" <swifty@freemail.hu>
To: netfilter list <netfilter@vger.kernel.org>
Subject: Re: Theoretical question: need for filter table in the POSTROUTING chain
Date: Thu, 25 Aug 2011 17:30:16 +0200 [thread overview]
Message-ID: <4E566A88.2040309@freemail.hu> (raw)
In-Reply-To: <4E56617E.4040704@riverviewtech.net>
> How about putting a reject route in the kernel routing table?
Yeah.. that is an alternative...
But:
- I want to REJECT any tcp sessions with tcp-reset,
- and any other protocoll with icmp-admin-prohibited.
- I would like to do it in iptables/netfilter.
The main question is: Why do not we have such a table in the POSTROUTING
chain?
>
> 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.
As I know this is true...
>
> 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
>
I have similar rules in my iptables firewall script. And you can put the
rules above in a table with the "ip route add table..." thing. And after
that you can "call" them with "ip rule ..." rules.
Thanx for your reply! :D
Swifty
next prev parent reply other threads:[~2011-08-25 15:30 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
2011-08-25 15:30 ` Gáspár Lajos [this message]
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=4E566A88.2040309@freemail.hu \
--to=swifty@freemail.hu \
--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