All of lore.kernel.org
 help / color / mirror / Atom feed
From: Antony Stone <Antony@Soft-Solutions.co.uk>
To: netfilter@lists.netfilter.org
Subject: Re: ipfilter on satellite receive only PC
Date: Sat, 26 Jun 2004 09:45:38 +0100	[thread overview]
Message-ID: <200406260945.38438.Antony@Soft-Solutions.co.uk> (raw)
In-Reply-To: <a0f69e5040626012851d190ba@mail.gmail.com>

On Saturday 26 June 2004 9:28 am, Askar Ali Khan wrote:

> this is out im running on my slackware, adjust it to your needs :)

That's okay - I run Slackware too :)

> #!/bin/bash
> #
> # Basic script to keep the nasties out of slack-lap
>
> # First we make the default policy to drop everything
> iptables -P INPUT DROP
> iptables -P FORWARD DROP
>
> # Allow established connections and programs that use
> loopback
>
> iptables -A INPUT -m state --state ESTABLISHED,RELATED
> -j ACCEPT
> iptables -A INPUT -s 127.0.0.0/8 -d 127.0.0.0/8 -i lo
> -j ACCEPT

# Also allow established connections *through* the router, as well as *to* it:

iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT

# Now allow first packets of the connections we want to become established

iptables -A FORWARD -i eth0 -p tcp --dport 80 -j ACCEPT
iptables -A FORWARD -i eth0 -p udp --dport 53 -j ACCEPT
iptables -A FORWARD -i eth0 -p tcp --dport 53 -j ACCEPT

> # Lets allow ssh to connect
>
> iptables -A INPUT -p tcp --dport 22 -i ppp0 -j ACCEPT
>
> #end script

The above rules should allow machines on your internal network (assumed to be 
connected to eth0, adjust if otherwise) to do DNS lookups and HTTP requests 
to the outside world.

Hopefully this gives you a template to which you can add more rules for 
whatever other protocols you want to allow.

Regards,

Antony.

-- 
The words "e pluribus unum" on the Great Seal of the United States are from a 
poem by Virgil entitled "Moretum", which is about cheese and garlic salad 
dressing.

                                                     Please reply to the list;
                                                           please don't CC me.



  reply	other threads:[~2004-06-26  8:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-06-26  7:41 ipfilter on satellite receive only PC yunus
2004-06-26  8:15 ` Antony Stone
2004-06-26  8:28   ` Askar Ali Khan
2004-06-26  8:45     ` Antony Stone [this message]
2004-06-26  9:33       ` Askar Ali Khan
2004-06-29 12:41         ` Ruprecht Helms

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=200406260945.38438.Antony@Soft-Solutions.co.uk \
    --to=antony@soft-solutions.co.uk \
    --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.