From: Chinh Nguyen <cnguyen@certicom.com>
To: Mattes Opel <mattes.opel@web.de>, netfilter@lists.netfilter.org
Subject: Re: Case concerning iptables filtering traffic from the internet in a NATed scenario
Date: Tue, 14 Mar 2006 11:59:50 -0500 [thread overview]
Message-ID: <4416F686.7020602@certicom.com> (raw)
In-Reply-To: <4416E5B5.3060004@web.de>
Mattes Opel wrote:
> Hello everybody,
>
> I'm new to this list, so I'm hoping not to break with any rules.
>
> I've got a case concerning iptables. Please excuse this long posting.
>
> Before explaining the scenario, here are my questions:
> 1) How do restrict internetworking traffic, which is originated by
> /destinated to the internet to a machine. Please read on, because it's
> sounds simple but is something special for me.
>
> The main problem is, that I can access the hosts only remote. A mistake
> would hurt very much.
In which case, you might want to test out iptables rules on a local setup first.
> The question to answer for solving the problem:
> How do I indentify a packets sourced by machine a) destinated to
> anywhere, which have to got through the router?
>
> And the other way around:
> How do I indentify packets destinated to machine a) sourced from
> anywhere, which have passed the router?
>
> Further a possibility to filter those packets in a second stage by
> protocol or port would be fine?
>
> AND don't forget the administrator's access:
> How do I identify packets, which where forwarded by the router. See c)
> in the secanrio description.
My two cents. Please refer to disclaimer above :). I am assuming you want rules
on machine A.
1. Internet-bound packets machine A should be filtered by a not source rule (or
simply accepted).
2. Replies coming back filtered by connection state (and possibly router MAC if
paranoid).
3. Administrative packets filtered by port (and possibly router MAC if paranoid).
1. -A OUTPUT -d ! 192.168.1.0/24 -j ACCEPT (or simply -A OUTPUT -j ACCEPT)
2. -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT (you could add -m mac
--mac-source $ROUTER_MAC to rule)
3. -A INPUT [-d ! 192.168.1.0/24] --protocol tcp --dport $ADMIN_PORT -j ACCEPT
(you could add -m mac --mac-source $ROUTER_MAC to rule)
next prev parent reply other threads:[~2006-03-14 16:59 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-14 15:48 Case concerning iptables filtering traffic from the internet in a NATed scenario Mattes Opel
2006-03-14 16:59 ` Chinh Nguyen [this message]
-- strict thread matches above, loose matches on Subject: below --
2006-03-14 15:54 Randy Grimshaw
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=4416F686.7020602@certicom.com \
--to=cnguyen@certicom.com \
--cc=mattes.opel@web.de \
--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.