From: Mike Wright <ebwximaurm@mailinator.com>
To: netfilter@lists.netfilter.org
Subject: Re: Using default policy drop in FORWARD chain´s
Date: Wed, 22 Mar 2006 09:42:01 -0800 [thread overview]
Message-ID: <44218C69.2020502@mailinator.com> (raw)
In-Reply-To: <BAY116-F11578E646F01D1A39B8C4DCED80@phx.gbl>
Juan Santamaria wrote:
> Hello Guys
Hi Juan,
>
> Nowdays, I ´ve been working in a firewall configuration. I want use
> default policy DROP, for the INPUT,FORWARD,OUTPUT chain´s. I using the
> redwall firewall, it has support for l7-protocols. I need to block msn,
> but when I apply the ruler to the forward chain it isn´t block.
>
> But when y change de default policy in Forward chain´s to ACCEPT, tha
> same ruler block the msn traffic.
>
> I appreciate some advices
>
> Cheerio!
>
> IPTABLES=/sbin/iptables
>
> $IPTABLES -F
> $IPTABLES -t nat -F
> $IPTABLES -X
> $IPTABLES -P INPUT DROP
> $IPTABLES -P OUTPUT DROP
> $IPTABLES -P FORWARD DROP
>
>
> $IPTABLES -A FORWARD -p tcp -m tcp -m layer7 --l7proto msnmessenger
> -j DROP
>
>
>
>
> $IPTABLES -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
> $IPTABLES -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
> $IPTABLES -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
> $IPTABLES -A OUTPUT -p icmp --icmp-type echo-reply -j ACCEPT
> $IPTABLES -A OUTPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
> $IPTABLES -A OUTPUT -p icmp --icmp-type echo-request -j ACCEPT
>
> #$IPTABLES -A FORWARD -s 10.0.109.20 -j DROP
>
> $IPTABLES -A INPUT -i eth2 -p tcp -m tcp --dport 22 -j ACCEPT
> $IPTABLES -A OUTPUT -o eth2 -p tcp -m tcp --sport 22 -m state --state
> RELATED,ESTABLISHED -j ACCEPT
>
I think the problem occurs here. It's important to put the more
specific rules in front of the more general rules or they will never be
seen because the condition has already been matched. Move the following
two rules to after those of "layer7" and all should be well.
Hope this is useful.
>
>
> $IPTABLES -A FORWARD -p tcp -m tcp --sport 80 -j ACCEPT
> $IPTABLES -A FORWARD -p tcp -m tcp --dport 80 -j ACCEPT
>
> $IPTABLES -A FORWARD -p tcp -m tcp --sport 80 -m layer7 --l7proto
> msnmessenger -j DROP
> $IPTABLES -A FORWARD -p tcp -m tcp --dport 80 -m layer7 --l7proto
> msnmessenger -j DROP
> $IPTABLES -A FORWARD -p tcp -m tcp --sport 443 -j ACCEPT
> $IPTABLES -A FORWARD -p tcp -m tcp --dport 443 -j ACCEPT
>
> $IPTABLES -A FORWARD -p udp -m udp --sport 53 -j ACCEPT
> $IPTABLES -A FORWARD -p udp -m udp --dport 53 -j ACCEPT
>
>
>
>
>
prev parent reply other threads:[~2006-03-22 17:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-03-21 14:59 Using default policy drop in FORWARD chain´s Juan Santamaria
2006-03-22 17:42 ` Mike Wright [this message]
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=44218C69.2020502@mailinator.com \
--to=ebwximaurm@mailinator.com \
--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