netfilter.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Bob Avery-Babel" <Bob@yellowbugcomputers.com>
To: netfilter@lists.netfilter.org
Subject: Still an IPTABLES newbie
Date: Tue, 26 Nov 2002 13:49:36 -0600	[thread overview]
Message-ID: <006101c29584$f31904c0$8f8aa0cf@um.umsystem.edu> (raw)
In-Reply-To: 20021126140315.GA12281@gnjilux.srk.fer.hr

Thanks to everyone for the tips on my last question. If anyone on this list
lives close to Columbia, MO, and would like to tutor me just give me a
holler. :-) Here are my new questions, after reading and re-reading the
first 128 pages of "Linux Firewalls" by Robert Ziegler.

My setup is a RH 8 box with an internal and an external nic. I also run all
my services (ssh, http, samba) on this box, as I am poor and this is only a
test box. :-). I have set all of my initial policies to drop as was
suggested here. Now I've slowly been trying to learn how to add exceptions
and understand just how the rules are constructed.

Many of the scripts I've looked at, and in Ziegler's book, they mention
"Symbolic Constants" that look like this:

INTERNET="eth0"        #Internet connected interface

Does IPTABLES recognize things like this, or is this just a convention to
help humans read the rules easier? If I defined all of the symbolic
constants at the start, where in the iptables script would I specifically
put them? Is there a command line option to add them or do I edit the file
directly to add the constants? When I tried to add the constants to the
beginning of my script it errored out on me.

Another question I have is how to add iptable rules. Usually when I set up
the first script I enter in the lines one at a time, and then when I've
added all of the lines I want I'll enter a command like:

iptables-save > /etc/sysconfig/iptables

Then I'll have a working iptables script. However, if I want to add
additional rules one by one at the cli and then do another iptables-save it
overwrites what I originally had. Are there easier options to do this, or is
it best just to edit the file itself?

My third question is about the format of the examples Robert Zeigler gives
in his Linux Firewalls book. He writes all of his rules like this, without
any explanation as to why. I guess it is supposed to be obvious? For
example:

iptables -A OUTPUT -o $INTERNET -p tcp \
-m multiport --destination-port \
$NFS_PORT,$OPENWINDS_PORT,$SOCKS_PORT,SQUID_PORT \
--syn -j DROP

Are these "\" just to indicate line breaks? Sorry if that is an obvious
question. oy!

Final question for the month, I swear...

In trying to understand forwarding the packets from my internal nic to my
public nic and vice versa. Do I need to make a rule for both inbound and
outbound traffic to each nic?

For instance, to allow Samba traffic to flow, here is what I am thinking:

Allow Internal network traffic to my internal nic card, does the traffic
need to flow to my public IP? I've only bound my samba server on my internal
nic and localhost.

Do I need to put a rule in place that looks something like:

-A OUTPUT -o eth1 -p tcp --sport 445 -j ACCEPT
#Anything headed outbound to the private nic, destined for port 445, Accept

I don't think that is right, but it is kind of how I understand (or don't
understand) the concept.

Thanks in advance to everyone!

Bob





  reply	other threads:[~2002-11-26 19:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-11-22 15:53 ULOG with -m state Iva Cabric Cabric
2002-11-25  0:45 ` Joel Newkirk
2002-11-25  8:16   ` Iva Cabric Cabric
2002-11-26 10:54   ` Iva Cabric Cabric
2002-11-26 13:53     ` Joel Newkirk
2002-11-26 14:03       ` Iva Cabric Cabric
2002-11-26 19:49         ` Bob Avery-Babel [this message]
2002-11-26 21:18           ` Still an IPTABLES newbie Dan Egli
2002-11-26 11:34   ` ULOG with -m state Iva Cabric Cabric

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='006101c29584$f31904c0$8f8aa0cf@um.umsystem.edu' \
    --to=bob@yellowbugcomputers.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;
as well as URLs for NNTP newsgroup(s).