From: "Rob Sterenborg" <rob@sterenborg.info>
To: 'netfilter EMAIL' <netfilter@lists.netfilter.org>
Subject: RE: Forwarding Problems
Date: Thu, 6 Mar 2003 19:17:34 +0100 [thread overview]
Message-ID: <000401c2e40c$a9280d30$0401000a@sterenborg.info> (raw)
In-Reply-To: <ABEKJILKOKKGGDJKHKDFOEBGCAAA.patrick@vikus.com>
> accepted. The problem
> is, if I use
>
> iptables -A FORWARD -j DROP
> or
> iptables -P FORWARD DROP
>
> they will drop all packets including the ones I already ACCEPTed.
I don't see any rule that makes the filter stateful.
When it's stateful, you don't have to worry about all the returning
packets.
I think that will make it work.
>
> example (want to allow all incoming and outgoing www traffic):
> iptables -A FORWARD -p tcp -d 192.168.1.0/24 --dport 80 -j ACCEPT
> iptables -A FORWARD -p tcp -d 192.168.1.0/24 --sport 80 -j ACCEPT
Packets sent *to* a webserver will most likely not come *from* port
80/tcp.
> iptables -A FORWARD -p tcp -s 192.168.1.0/24 --dport 80 -j ACCEPT
> iptables -A FORWARD -p tcp -s 192.168.1.0/24 --sport 80 -j ACCEPT
> iptables -A FORWARD -j DROP
So, making it stateful, it would look like this :
iptables -P FORWARD DROP
iptables -A FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
iptables -A FORWARD -d 192.168.1.0/24 -p tcp --dport 80 -j ACCEPT
Gr,
Rob
next prev parent reply other threads:[~2003-03-06 18:17 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-03-06 16:56 Forwarding Problems Patrick Ahler
2003-03-06 18:17 ` Rob Sterenborg [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-03-06 18:10 Khanh Tran
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='000401c2e40c$a9280d30$0401000a@sterenborg.info' \
--to=rob@sterenborg.info \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox