Linux Netfilter discussions
 help / color / mirror / Atom feed
From: karimas@kfupm.edu.sa
To: duren duren <jusdurian_jr@yahoo.com>
Cc: netfilter@vger.kernel.org
Subject: Re: Ask: Default Policy DROP for INPUT, OUTPUT and FORWARD
Date: Sun, 17 Feb 2008 10:15:47 +0300	[thread overview]
Message-ID: <7c9ec6914d6.14d67c9ec69@kfupm.edu.sa> (raw)
In-Reply-To: <24410.61709.qm@web55403.mail.re4.yahoo.com>

Your following commands will not work as state NEW is not there in the 
INPUT chain, but if you add NEW, every one now can access your router.

>># Allow UDP, DNS and Passive FTP
>>$IPT -A INPUT -m state --state NEW,ESTABLISHED,RELATED -j ACCEPT
>>$IPT -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT

use the following command so that your client can access the router 
through ssh but add before tha above mentioned command.
iptables -A INPUT -s client_ip -dport 22 --state NEW, ESTABLISHED -j 
ACCEPT

Regards
Karim Asif


----- Original Message -----
From: duren duren <jusdurian_jr@yahoo.com>
Date: Sunday, February 17, 2008 9:20 am
Subject: Ask: Default Policy DROP for INPUT, OUTPUT and FORWARD
To: netfilter@vger.kernel.org

> i want build firewal for router in one machine as a
> squid proxy server,  caching dns server and bandwith
> limiter with HTB.
> 
> i use default policy DROP for forward, input, and
> output
> 
> -------- code ----------------
> # Clean old firewall
> $IPT -F
> $IPT -X
> $IPT -t nat -F
> $IPT -t nat -X
> $IPT -t mangle -F
> $IPT -t mangle -X
> 
> $MPROBE ip_conntrack
> $MPROBE ip_conntrack_ftp
> $MPROBE ip_nat_ftp
> $MPROBE ip_nat_irc
> 
> # Setting default filter policy
> $IPT -P INPUT DROP
> $IPT -P OUTPUT DROP
> $IPT -P FORWARD DROP
> 
> # Unlimited access to loop back
> $IPT -A INPUT -i lo -j ACCEPT
> $IPT -A OUTPUT -o lo -j ACCEPT
> 
> # Allow UDP, DNS and Passive FTP
> $IPT -A INPUT -m state --state ESTABLISHED,RELATED -j
> ACCEPT
> $IPT -A OUTPUT -m state --state ESTABLISHED,RELATED -j
> ACCEPT
> ------------ end of code
> --------------------------------------
> 
> and my problem is, what filter i must write so my
> client can connect into my router.
> first i only define PREROUTING, FORWARD and
> POSTROUTING, but my client can't ping into router.
> 
> so, if i want default policy DROP for forward, input,
> output, prerouting and postrouting, what i want to do?
> must i define all of this for allow my client?
> 
> 
> thanks
> 
> 
>      
> 
________________________________________________________________________
____________Never miss a thing.  Make Yahoo your home page. 
> http://www.yahoo.com/r/hs
> -
> To unsubscribe from this list: send the line "unsubscribe 
> netfilter" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 

  reply	other threads:[~2008-02-17  7:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-17  6:19 Ask: Default Policy DROP for INPUT, OUTPUT and FORWARD duren duren
2008-02-17  7:15 ` karimas [this message]
2008-02-17  9:27 ` Rob Sterenborg

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=7c9ec6914d6.14d67c9ec69@kfupm.edu.sa \
    --to=karimas@kfupm.edu.sa \
    --cc=jusdurian_jr@yahoo.com \
    --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