From: "John A. Sullivan III" <jsullivan@opensourcedevelopmentcorp.com>
To: Jason Williams <jwilliams@courtesymortgage.com>
Cc: Netfilter users list <netfilter@lists.netfilter.org>
Subject: Re: Help with iptables script
Date: Wed, 15 Dec 2004 13:27:24 -0500 [thread overview]
Message-ID: <1103135244.2023.33.camel@localhost> (raw)
In-Reply-To: <6.1.2.0.0.20041215090840.025e0ec0@corpmail.courtesymortgage.com>
On Wed, 2004-12-15 at 12:16, Jason Williams wrote:
> >Welcome to netfilter/iptables - it's a fabulous product. You do indeed
> >seem to know what you are doing. I'll make some comments in your text.
>
> Thanks for the welcome. I am quite intrigued with iptables. Definitely
> different and a new thing to learn.
>
> <snip>
> > > #Simple NAT setup
> > >
> > > $IPTABLES -t nat -A POSTROUTING -o $INET_IFACE -j SNAT --to-source $INET_IP
>
> This should be correct for my NAT setup on my private LAN correct? Think
> so, just want to double check.
Yes, that looks fine. You could further constrain it by -s $LAN_IP but
I don't think it's necessary.
>
> > >
> > > # Accept the packets we actually want to forward
> > >
> > > $IPTABLES -A FORWARD -i $LAN_IFACE -j ACCEPT
> > > $IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
> > > $IPTABLES -A FORWARD -m limit --limit 3/minute --limit-burst 3 -j LOG
> > > --log-level DEBUG --log-prefix "IPT FORWARD packet died: "
> > >
> > > # INPUT chain
> > >
> > > $IPTABLES -A INPUT -p tcp -j bad_tcp_packets
> >Since you're not accepting any packets on the INPUT chain, you don't
> >need to filter bad packets unless you want to log them. Are you sure
> >you don't want to accept RELATED,ESTABLISHED traffic on your INPUT
> >chain?
>
> Hmm. Good point. Just to make sure I follow, even though I am not accepting
> any packets on the input chain, traffic from the private LAN still should
> traverse through the firewall and back correct? Assuming that is correct,
> then the problems i would have then would be the loopback interface (stuff
> like X windows, subsystems) and also when the host itself tries to call the
> interent for patches, packages etc. Is that a correct assumption?
Yes, exactly.
>
> > >
> > >
> > > # OUTPUT chain
> > >
> > > $IPTABLES -A OUTPUT -p tcp -j bad_tcp_packets
> >Are you expecting bad packets on your OUTPUT chain?
> > >
> > > #
> > > # Special OUTPUT rules to decide which IP's to allow.
> > > #
> > >
> > > $IPTABLES -A OUTPUT -p ALL -s $LAN_IP -j ACCEPT
> > > $IPTABLES -A OUTPUT -p ALL -s $INET_IP -j ACCEPT
> >I believe you can drop the -p ALL. What about traffic on lo?
>
> Yep. Forgot the Loopback interface.
>
> I will be pouring over my book and how-to's today.
> just a quick question. Is there a website, other than the netfiler website
> that has some sample table scripts? I'd like to see just a few examples of
> simple iptable scripts so I can further wrap my head around this.
> My intentions with this first script was to put a simple firewall script
> that would block my private lan, do NAT and of course, pass out traffic to
> and from the private LAN.
<snip>
I've always found Oskar Andreasson's tutorial very helpful and it
includes a number of scripts
(http://iptables-tutorial.frozentux.net/iptables-tutorial.html). I think
there are some sample scripts on the Shorewall site
(http://www.shorewall.net) and there are a few slide shows on
http://iscs.sourceforge.net
Good luck - John
--
John A. Sullivan III
Open Source Development Corporation
Financially sustainable open source development
http://www.opensourcedevel.com
prev parent reply other threads:[~2004-12-15 18:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-12-15 0:22 Help with iptables script Jason Williams
2004-12-15 1:17 ` John A. Sullivan III
2004-12-15 17:16 ` Jason Williams
2004-12-15 18:21 ` Rob Sterenborg
2004-12-15 18:27 ` John A. Sullivan III [this message]
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=1103135244.2023.33.camel@localhost \
--to=jsullivan@opensourcedevelopmentcorp.com \
--cc=jwilliams@courtesymortgage.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