All of lore.kernel.org
 help / color / mirror / Atom feed
From: Patrick Maartense <patrick@patrick.at>
To: Ralf Spenneberg <lists@spenneberg.org>
Cc: Netfilter <netfilter@lists.netfilter.org>
Subject: Re: How to block all ports except port 21,22,80,8080 ???
Date: Tue, 18 Feb 2003 11:15:21 +0100	[thread overview]
Message-ID: <3E5207B9.7C2BEDFA@patrick.at> (raw)
In-Reply-To: 1045560648.1913.39.camel@kermit.spenneberg.de

it would be MUCH better to

iptables -p INPUT DROP # default drop
then allow only these ports
iptables -A INPUT -p tcp -m multiport  --dport 21,22,80,8080 -j ACCEPT

safe thinking: Default : drop, allow only what needed.



Ralf Spenneberg wrote:

> Am Die, 2003-02-18 um 09.57 schrieb Ralf Spenneberg:
> > Am Die, 2003-02-18 um 09.12 schrieb jacob_chan:
> > > How to block all ports except port 21,22,80,8080 ???
> > >
> > > Dear all,
> > >
> > > I want to block all ports except port 21,22,80,8080.
> > Block for what? Input? What protocol? TCP?
> > iptables -A INPUT -p tcp ! --dport 21,22,80,8080 -j DROP
> Missed the multiport part:
>
> iptables -A INPUT -p tcp -m multiport ! --dport 21,22,80,8080 -j DROP
>
> > Cheers,
> >
> > Ralf
> > >
> > > Any help appreciated.
> > >
> > > Best regards,
> > >
> > > Jacob
> > --
> > Ralf Spenneberg
> > RHCE, RHCX
> >
> > IPsec/PPTP Kernels for Red Hat Linux:
> > http://www.spenneberg.com/.net/.org/.de
> > Honeynet Project Mirror:                http://honeynet.spenneberg.org
> > Snort Mirror:                           http://snort.spenneberg.org
> --
> Ralf Spenneberg
> RHCE, RHCX
>
> IPsec/PPTP Kernels for Red Hat Linux:
> http://www.spenneberg.com/.net/.org/.de
> Honeynet Project Mirror:                http://honeynet.spenneberg.org
> Snort Mirror:                           http://snort.spenneberg.org



  reply	other threads:[~2003-02-18 10:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-02-18  8:12 How to block all ports except port 21,22,80,8080 ??? jacob_chan
2003-02-18  8:57 ` Ralf Spenneberg
2003-02-18  9:30   ` Ralf Spenneberg
2003-02-18 10:15     ` Patrick Maartense [this message]
2003-02-18 12:45       ` Ralf Spenneberg
2003-02-18 13:40       ` How to Block MSN Miguel Amador L.
2003-02-18 15:49         ` Arnt Karlsen
2003-02-18 16:03       ` How to block all ports except port 21,22,80,8080 ??? Alexander W. Janssen
2003-02-18 12:19         ` Re2: " Pablo Allietti
2003-02-18 19:40           ` Alexander W. Janssen
2003-02-18 19:51           ` Re2: " Alexander W. Janssen
2003-02-18  9:02 ` Joel Newkirk

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=3E5207B9.7C2BEDFA@patrick.at \
    --to=patrick@patrick.at \
    --cc=lists@spenneberg.org \
    --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.