Linux Netfilter discussions
 help / color / mirror / Atom feed
From: Georgi Alexandrov <tehlists@hotpop.com>
To: netfilter@lists.netfilter.org
Subject: Re: minimal iptables ruleset for laptop
Date: Tue, 24 May 2005 13:31:15 +0300	[thread overview]
Message-ID: <42930273.10208@hotpop.com> (raw)
In-Reply-To: <d6utcg$6hb$1@sea.gmane.org>

Volkm@r wrote:

>Sorry for this newbie question - I'm just learning about iptables.
>
>What I have is a laptop that I want to protect against external
>intrusion. Relevant interfaces are
>
>- eth0, which is LAN and sometimes DHCP sometimes pppoe
>- eth1, which is WLAN and sometimes behind my private AP
>        and sometimes behind company's or public APs
>
>Of course, this laptop would never have to act as a router.
>I want to prevent any external intrusion but be able to connect myself
>to any external service. AND I want to be able to run some services
>(X11, CUPS, Tomcat,...) just for myself.
>
>>From somewhere on the internet I got the following snippet which I think
>may be suitable for ppp0 as the only interface. But I couldn't find out
>how to change it for my needs.
>
>-------------------------------------------------------------------------
># Generated by iptables-save v1.2.11 on Mon May 23 15:54:20 2005
>*filter
>:INPUT ACCEPT [10502:1065067]
>:FORWARD ACCEPT [0:0]
>:OUTPUT ACCEPT [1529512:141800679]
>:block - [0:0]
>-A INPUT -j block
>-A FORWARD -j block
>-A block -m state --state RELATED,ESTABLISHED -j ACCEPT
>-A block -i ! ppp0 -m state --state NEW -j ACCEPT
>-A block -j DROP
>COMMIT
># Completed on Mon May 23 15:54:20 2005
>-------------------------------------------------------------------------
>
>Any help will be much appreciated.
>  
>
something like this:

######################### start ###########################

iptables -F
iptables -X
iptables -Z
iptables -t nat -F
iptables -t nat -X
iptables -t nat -Z
iptables -t mangle -F
iptables -t mangle -X
iptables -t mangle -Z

iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT ACCEPT

iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
iptables -A INPUT -i lo -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 3 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 11 -j ACCEPT
iptables -A INPUT -p icmp --icmp-type 12 -j ACCEPT
iptables -A INPUT -p tcp --syn --dport 113 -j REJECT --reject-with tcp-reset

############################# end #################################

I think the above ruleset is sufficient. If you have any questions about 
it - just ask.

regards,
Georgi Alexandrov


  reply	other threads:[~2005-05-24 10:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-24  9:51 minimal iptables ruleset for laptop Volkm@r
2005-05-24 10:31 ` Georgi Alexandrov [this message]
2005-05-24 12:23   ` Volkm@r
2005-05-25  9:18     ` Georgi Alexandrov
2005-05-25 10:42       ` Volkm@r

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=42930273.10208@hotpop.com \
    --to=tehlists@hotpop.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