From: Jeff Mesch <mesch@NanoTech.Wisc.EDU>
To: netfilter@lists.netfilter.org
Subject: Newbie - Default Deny Setup
Date: Wed, 07 May 2003 14:52:15 -0500 [thread overview]
Message-ID: <3EB963EF.2060506@nanotech.wisc.edu> (raw)
I'm completely new to iptables, and am having a problem setting up a
basic firewall, that follows default deny. I'm guessing it's a very
basic error that I'm overlooking. I'm using FWBuilder to create the rules.
I cannot get any traffic out from the internal side. According to the
log file, it is dropping the traffic as a result of RULE_4.
Any suggestions would be greatly appreciated.
Thanks.
->Jeff
-------
#
# Rule 0(NAT)
#
#
$IPTABLES -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT
--to-source 198.150.6.16
#
#
$IPTABLES -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A OUTPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
#
# Rule 0(eth0)
#
# Anti-spoofing rule
#
$IPTABLES -N eth0_In_RULE_0
$IPTABLES -A INPUT -i eth0 -s 198.150.6.16 -j eth0_In_RULE_0
$IPTABLES -A INPUT -i eth0 -s 192.168.1.1 -j eth0_In_RULE_0
$IPTABLES -A INPUT -i eth0 -s 192.168.0.0/24 -j eth0_In_RULE_0
$IPTABLES -A FORWARD -i eth0 -s 198.150.6.16 -j eth0_In_RULE_0
$IPTABLES -A FORWARD -i eth0 -s 192.168.1.1 -j eth0_In_RULE_0
$IPTABLES -A FORWARD -i eth0 -s 192.168.0.0/24 -j eth0_In_RULE_0
$IPTABLES -A eth0_In_RULE_0 -j LOG --log-level info --log-prefix
"RULE 0 -- DROP "
$IPTABLES -A eth0_In_RULE_0 -j DROP
#
# Rule 1(eth0)
#
# Anti-spoofing rule
#
$IPTABLES -N Cid3EB03CD7.0
$IPTABLES -A OUTPUT -o eth0 -j Cid3EB03CD7.0
$IPTABLES -A Cid3EB03CD7.0 -o eth0 -j RETURN
$IPTABLES -A Cid3EB03CD7.0 -o eth0 -j DROP
$IPTABLES -N Cid3EB03CD7.1
$IPTABLES -A FORWARD -o eth0 -j Cid3EB03CD7.1
$IPTABLES -A Cid3EB03CD7.1 -o eth0 -s 192.168.0.0/24 -j RETURN
$IPTABLES -N eth0_Out_RULE_1_3
$IPTABLES -A Cid3EB03CD7.1 -o eth0 -j eth0_Out_RULE_1_3
$IPTABLES -A eth0_Out_RULE_1_3 -j LOG --log-level info --log-prefix
"RULE 1 -- DROP "
$IPTABLES -A eth0_Out_RULE_1_3 -j DROP
#
# Rule 0(lo)
#
# allow everything on loopback
#
$IPTABLES -A INPUT -i lo -j ACCEPT
$IPTABLES -A FORWARD -i lo -j ACCEPT
$IPTABLES -A OUTPUT -o lo -j ACCEPT
$IPTABLES -A FORWARD -o lo -j ACCEPT
#
# Rule 0(global)
#
# block fragments
#
$IPTABLES -N RULE_0
$IPTABLES -A OUTPUT -p ip -f -j RULE_0
$IPTABLES -A INPUT -p ip -f -j RULE_0
$IPTABLES -A FORWARD -p ip -f -j RULE_0
$IPTABLES -A RULE_0 -j LOG --log-level info --log-prefix "RULE 0 --
DROP "
$IPTABLES -A RULE_0 -j DROP
#
# Rule 1(global)
#
# ssh access to firewall
#
$IPTABLES -A OUTPUT -p tcp -d 198.150.6.16 --destination-port 22 -m
state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -p tcp -d 192.168.1.1 --destination-port 22 -m
state --state NEW -j ACCEPT
$IPTABLES -A INPUT -p tcp --destination-port 22 -m state --state NEW
-j ACCEPT
#
# Rule 2(global)
#
# firewall uses DNS server on Inet
#
$IPTABLES -A INPUT -p udp -s 198.150.6.16 --destination-port 53 -m
state --state NEW -j ACCEPT
$IPTABLES -A INPUT -p udp -s 192.168.1.1 --destination-port 53 -m
state --state NEW -j ACCEPT
$IPTABLES -A OUTPUT -p udp --destination-port 53 -m state --state NEW
-j ACCEPT
#
# Rule 3(global)
#
# 'masquerading' rule
#
$IPTABLES -A INPUT -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
$IPTABLES -A FORWARD -s 192.168.0.0/24 -m state --state NEW -j ACCEPT
#
# Rule 4(global)
#
# 'catch all' rule
#
$IPTABLES -N RULE_4
$IPTABLES -A OUTPUT -j RULE_4
$IPTABLES -A INPUT -j RULE_4
$IPTABLES -A FORWARD -j RULE_4
$IPTABLES -A RULE_4 -j LOG --log-level info --log-prefix "RULE 4 --
DROP "
$IPTABLES -A RULE_4 -j DROP
#
#
echo 1 > /proc/sys/net/ipv4/ip_forward
next reply other threads:[~2003-05-07 19:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-05-07 19:52 Jeff Mesch [this message]
2003-05-07 21:18 ` Newbie - Default Deny Setup Myles Uyema
2003-05-07 21:41 ` Jeff Mesch
2003-05-07 22:19 ` Myles Uyema
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=3EB963EF.2060506@nanotech.wisc.edu \
--to=mesch@nanotech.wisc.edu \
--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.