* newbie question about port blocking
@ 2003-04-17 13:49 kenn murrah
2003-04-17 14:22 ` Kim Jensen
0 siblings, 1 reply; 6+ messages in thread
From: kenn murrah @ 2003-04-17 13:49 UTC (permalink / raw)
To: netfilter
Sorry for the elementary nature of this question ... I've just installed
linux and have a transparent proxy working using iptables ... but my goal is
to block ALL non-http traffic in both directions ... that is, i want to
allow web access but no instant messenging, no ftp, etc.
is there a simple line or two that i can add to iptables? please feel free
to tell me to RTFM, but the tutorial i just downloaded is 151 pages, and i
admit that i'm looking for a fast solution this morning ... (i'll study the
manual on the way home tonight on the train -- i promise!)
can anyone help me out? all advice MOST appreciated.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: newbie question about port blocking
2003-04-17 13:49 newbie question about port blocking kenn murrah
@ 2003-04-17 14:22 ` Kim Jensen
2003-04-17 14:33 ` kenn murrah
2003-04-17 14:37 ` Kim Jensen
0 siblings, 2 replies; 6+ messages in thread
From: Kim Jensen @ 2003-04-17 14:22 UTC (permalink / raw)
To: kenn murrah, netfilter
Hi Kenn,
A simple setup will be something like this:
iptables -i lo -j ACCEPT
iptables -p tcp --dport 80 -j ACCEPT
iptables -j DROP
If you are using a transparent proxy, ala Squid, you may have to add some more
rules.
/Kim
On Thursday 17 April 2003 15:49, kenn murrah wrote:
> Sorry for the elementary nature of this question ... I've just installed
> linux and have a transparent proxy working using iptables ... but my goal
> is to block ALL non-http traffic in both directions ... that is, i want to
> allow web access but no instant messenging, no ftp, etc.
>
> is there a simple line or two that i can add to iptables? please feel free
> to tell me to RTFM, but the tutorial i just downloaded is 151 pages, and i
> admit that i'm looking for a fast solution this morning ... (i'll study the
> manual on the way home tonight on the train -- i promise!)
>
> can anyone help me out? all advice MOST appreciated.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: newbie question about port blocking
2003-04-17 14:22 ` Kim Jensen
@ 2003-04-17 14:33 ` kenn murrah
2003-04-17 15:05 ` Cedric Blancher
2003-04-17 14:37 ` Kim Jensen
1 sibling, 1 reply; 6+ messages in thread
From: kenn murrah @ 2003-04-17 14:33 UTC (permalink / raw)
To: netfilter
Thanks, Kim. I'll try that ...
BTW, i *AM* using squid, and my iptables already includes:
iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
REDIRECT --to-port 3128
so, will the setup you describe be the only thing i need to add in order to
block non-http ports?
Thanks again,
Kenn
----- Original Message -----
From: "Kim Jensen" <kimj@dawn.dk>
To: "kenn murrah" <kenn@thebytebusiness.com>;
<netfilter@lists.netfilter.org>
Sent: Thursday, April 17, 2003 9:22 AM
Subject: Re: newbie question about port blocking
> Hi Kenn,
>
> A simple setup will be something like this:
>
> iptables -i lo -j ACCEPT
> iptables -p tcp --dport 80 -j ACCEPT
> iptables -j DROP
>
> If you are using a transparent proxy, ala Squid, you may have to add some
more
> rules.
>
> /Kim
>
> On Thursday 17 April 2003 15:49, kenn murrah wrote:
> > Sorry for the elementary nature of this question ... I've just installed
> > linux and have a transparent proxy working using iptables ... but my
goal
> > is to block ALL non-http traffic in both directions ... that is, i want
to
> > allow web access but no instant messenging, no ftp, etc.
> >
> > is there a simple line or two that i can add to iptables? please feel
free
> > to tell me to RTFM, but the tutorial i just downloaded is 151 pages, and
i
> > admit that i'm looking for a fast solution this morning ... (i'll study
the
> > manual on the way home tonight on the train -- i promise!)
> >
> > can anyone help me out? all advice MOST appreciated.
>
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: newbie question about port blocking
2003-04-17 14:22 ` Kim Jensen
2003-04-17 14:33 ` kenn murrah
@ 2003-04-17 14:37 ` Kim Jensen
1 sibling, 0 replies; 6+ messages in thread
From: Kim Jensen @ 2003-04-17 14:37 UTC (permalink / raw)
To: kenn murrah, netfilter
Whoopsie,
Rules should be:
$ iptables -t filter -A INPUT -i lo -j ACCEPT
$ iptables -t filter -A INPUT -p tcp --dport 80 -j ACCEPT
$ iptables -t filter -A INPUT -j DROP
$ iptables -t filter -A FORWARD -p tcp --dport 80 -j ACCEPT
$ iptables -t filter -A FORWARD -j DROP
This allows nothing but web, however you may wish to open up other things as
well, such as a few ICMP services, and as I mentioned - if you are using a
transparent proxy, you have to add some additional rules to allow the proxy
to work..
/Kim
On Thursday 17 April 2003 15:49, kenn murrah wrote:
> Sorry for the elementary nature of this question ... I've just installed
> linux and have a transparent proxy working using iptables ... but my goal
> is to block ALL non-http traffic in both directions ... that is, i want to
> allow web access but no instant messenging, no ftp, etc.
>
> is there a simple line or two that i can add to iptables? please feel free
> to tell me to RTFM, but the tutorial i just downloaded is 151 pages, and i
> admit that i'm looking for a fast solution this morning ... (i'll study the
> manual on the way home tonight on the train -- i promise!)
>
> can anyone help me out? all advice MOST appreciated.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: newbie question about port blocking
2003-04-17 14:33 ` kenn murrah
@ 2003-04-17 15:05 ` Cedric Blancher
2003-04-17 20:06 ` kenn murrah
0 siblings, 1 reply; 6+ messages in thread
From: Cedric Blancher @ 2003-04-17 15:05 UTC (permalink / raw)
To: kenn murrah; +Cc: netfilter
Le jeu 17/04/2003 à 16:33, kenn murrah a écrit :
> BTW, i *AM* using squid, and my iptables already includes:
> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
> REDIRECT --to-port 3128
> so, will the setup you describe be the only thing i need to add in order to
> block non-http ports?
If you want to block everything else, than desactivate routing :
echo 0 > /proc/sys/net/ipv4/ip_forward
You can also set FROWARD chain policy to DROP :
iptables -P FORWARD DROP
This way, everything is denied, unless you use HTTP proxy.
--
Cédric Blancher <blancher@cartel-securite.fr>
Consultant en sécurité des systèmes et réseaux - Cartel Sécurité
Tél: +33 (0)1 44 06 97 87 - Fax: +33 (0)1 44 06 97 99
PGP KeyID:157E98EE FingerPrint:FA62226DA9E72FA8AECAA240008B480E157E98EE
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: newbie question about port blocking
2003-04-17 15:05 ` Cedric Blancher
@ 2003-04-17 20:06 ` kenn murrah
0 siblings, 0 replies; 6+ messages in thread
From: kenn murrah @ 2003-04-17 20:06 UTC (permalink / raw)
To: Cedric Blancher; +Cc: netfilter
well, i DID try this idea from Cedric ..
----- Original Message -----
From: "Cedric Blancher" <blancher@cartel-securite.fr>
Le jeu 17/04/2003 à 16:33, kenn murrah a écrit :
> BTW, i *AM* using squid, and my iptables already includes:
> iptables -t nat -A PREROUTING -i eth0 -p tcp --dport 80 -j
> REDIRECT --to-port 3128
> so, will the setup you describe be the only thing i need to add in order
to
> block non-http ports?
You can also set FROWARD chain policy to DROP :
iptables -P FORWARD DROP
This way, everything is denied, unless you use HTTP proxy.
as well as THIS idea from Kim:
> Rules should be:
> $ iptables -t filter -A INPUT -i lo -j ACCEPT
> $ iptables -t filter -A INPUT -p tcp --dport 80 -j ACCEPT
> $ iptables -t filter -A INPUT -j DROP
> $ iptables -t filter -A FORWARD -p tcp --dport 80 -j ACCEPT
> $ iptables -t filter -A FORWARD -j DROP
but both of them resulted in my not being about to access HTTP, either ...
what am I doing wrong here? Thanks again to both Cedric and Kim ... can you
or anybody else spot what I'm doing wrong ???
all replies appreciated.
Kenn
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2003-04-17 20:06 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-04-17 13:49 newbie question about port blocking kenn murrah
2003-04-17 14:22 ` Kim Jensen
2003-04-17 14:33 ` kenn murrah
2003-04-17 15:05 ` Cedric Blancher
2003-04-17 20:06 ` kenn murrah
2003-04-17 14:37 ` Kim Jensen
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.