All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tim Evans <tkevans@tkevans.com>
To: netfilter@lists.netfilter.org
Subject: Translating Ziegler Book ipchains Rules
Date: Wed, 11 Dec 2002 07:00:46 -0500 (EST)	[thread overview]
Message-ID: <200212111200.gBBC0kK9004655@osprey.tkevans.com> (raw)

We've been using the example script from the Ziegler _Linux Firewalls_
book as a base for our firewall for some years, and are now "translating"
it to use iptables.

That script has nice, symmetrical pairs of rules like this:

# HTTP (80) - accessing remote web sites as a client
ipchains -A output -i eth1 -s $IPADDR $UNPRIV -d 0/0 80 -p tcp -j ACCEPT
ipchains -A input -i eth1 -s 0/0 80 -d $IPADDR $UNPRIV -p tcp ! -y -j ACCEPT

With connection tracking in iptables, can all these pairs be cut to just
one rule, like this:

$IPTABLES -A FORWARD -o eth1 -s $IPADDR -p tcp --sport $UNPRIV  \
--dport 80 -j ACCEPT

Or do I still need this, too?

$IPTABLES -A FORWARD -i eth1  -p tcp --sport 80 -d $IPADDR \
--dport $UNPRIV ! --syn -j ACCEPT

Similarly, is it necessary to have multiple rules for ftp control
and data ports, or does ip_conntrack_ftp handle everything with just
one rule, like this:

$IPTABLES -A FORWARD -o eth1 -s $IPADDR -p tcp --sport $UNPRIV  \
--dport 21 -j ACCEPT

Or do I need these in pairs also, with parallel ones for port 21?

Thanks, I will summarize.
--
Tim Evans		|    5 Chestnut Court
tkevans@tkevans.com	|    Owings Mills, MD 21117
http://www.tkevans.com/	|    443-394-3864;410-748-0160 (pager)



             reply	other threads:[~2002-12-11 12:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-12-11 12:00 Tim Evans [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-12-11 12:43 Translating Ziegler Book ipchains Rules Reckhard, Tobias

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=200212111200.gBBC0kK9004655@osprey.tkevans.com \
    --to=tkevans@tkevans.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 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.