Linux Netfilter discussions
 help / color / mirror / Atom feed
* Secure Firewall
@ 2005-08-09 13:24 Alexander Salmin
  2005-08-11 13:29 ` Sp0oKeR
  2005-08-12 19:09 ` curby .
  0 siblings, 2 replies; 3+ messages in thread
From: Alexander Salmin @ 2005-08-09 13:24 UTC (permalink / raw)
  To: netfilter

Hello friends,

I'm trying to set up a secure NAT firewall in my home, for that I need
help with some rules.

I've got a total of four computers, including the server. 

These are the ones who should be NAT'ed:

#1 --- 192.168.51.20 --- Should be able to access all internet.
#2 --- 192.168.51.40 --- Should be able to access only websites (port 80,443).
#3 --- 192.168.51.80 --- Should be able to access only websites (port 80,443).

This is how my non-working iptables-script looks like right now:
-------------------------------------------------------------------------------------
INT="eth0"
EXT="eth1"
IPTABLES=/sbin/iptables

$IPTABLES -F INPUT
$IPTABLES -F OUTPUT
$IPTABLES -F FORWARD
$IPTABLES -F -t nat

$IPTABLES -P INPUT DROP
$IPTABLES -P OUTPUT DROP
$IPTABLES -P FORWARD DROP

$IPTABLES -A INPUT -i $INT -m state --state ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A INPUT -i eth0 -p icmp -j ACCEPT
$IPTABLES -A INPUT -p UDP --dport bootps -i $INT -j ACCEPT
$IPTABLES -A INPUT -p UDP --dport domain -i $INT -j ACCEPT

$IPTABLES -t nat -A POSTROUTING -s 192.168.51.20 -o $EXT -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -s 192.168.51.40 -dport 80 -o $EXT -j MASQUERADE
$IPTABLES -t nat -A POSTROUTING -s 192.168.51.80 -dport 80 -o $EXT -j MASQUERADE

$IPTABLES -A INPUT -j DROP
-------------------------------------------------------------------------------------

Somehow, it doesn't work with -dport 80, and I believe that I have
missed some allow-rules because the -j DROP denies the computer from
192.168.51.20 too.

Any help would be appreciated!


Thanks,
--Alexander.


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-08-12 19:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-08-09 13:24 Secure Firewall Alexander Salmin
2005-08-11 13:29 ` Sp0oKeR
2005-08-12 19:09 ` curby .

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox