From: "Thiago Lima " <thiagolima@webforce.com.br>
To: netfilter@lists.netfilter.org
Subject: SNAT firewall maybe compromised. Misconfiguration?
Date: Mon, 28 Apr 2003 11:23:48 -0300 [thread overview]
Message-ID: <00a501c30d91$cf0b7740$1800a8c0@medusa> (raw)
I'm using iptables v1.2.6a (RPM from redhat) in a firewall that has
5 external ips and lots of machines in the internal network.
iptables should port foward services based on external ip/port to
some internal machines and port.
Everything is working fine, but I've seen entries in my internal
servers logs to 192.168.1.254 and my internal network is 192.168.0.254.
Ping shows that 192.168.1.254 does not exist. So I'm thinking that
maybe my firewall script has a hole. And someone discoved it.
My external interface is eth0 (200.200.200.111~115 eth0:1~eth0:5)
and the internal is eth1 (192.168.0.254)
Can someone point me if I'm doind something very wrong here?
Thanks alot
Thiago Lima.
Here goes my fw script.
-- fw.sh
echo -n Starting firewal ..
# enable packet forwarind
echo 1 > /proc/sys/net/ipv4/ip_forward
echo -n .
# clear all tables
/sbin/iptables -t nat -F
/sbin/iptables -F
echo -n .
# eth0 is the external interface. blocking packages to internal net
/sbin/iptables -A INPUT -d 192.168.0.0/24 -i eth0 -j DROP
echo -n .
# install snat
/sbin/iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-source
200.200.200.110
/sbin/iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j SNAT
--to 200.200.200.110
echo -n .
# port forwarding
# http goes to server #1
/sbin/iptables -A PREROUTING -t nat -p tcp -d 200.200.200.111 --dport
80 -j DNAT --to 192.168.0.1:80
/sbin/iptables -A PREROUTING -t nat -p tcp -d 200.200.200.111 --dport
443 -j DNAT --to 192.168.0.1:443
echo -n .
## pop goes to server #2
/sbin/iptables -A PREROUTING -t nat -p tcp -d 200.200.200.112 --dport
110 -j DNAT --to 192.168.0.4:110
echo -n .
# DNS goes to server #3
/sbin/iptables -A PREROUTING -t nat -p tcp -d 200.200.200.114 --dport
53 -j DNAT --to 192.168.0.6
/sbin/iptables -A PREROUTING -t nat -p udp -d 200.200.200.114 --dport
53 -j DNAT --to 192.168.0.6
echo -n .
# enables access from internet net to external virtual servers
/sbin/iptables -A POSTROUTING -t nat -d 192.168.0.0/24 -s
192.168.0.0/24 -j SNAT --to 192.168.1.254
--cut
next reply other threads:[~2003-04-28 14:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-28 14:23 Thiago Lima [this message]
2003-04-29 14:55 ` SNAT firewall maybe compromised. Misconfiguration? Alistair Tonner
2003-04-29 15:09 ` Thiago Lima
2003-04-29 17:08 ` Laila Winblad Berntsen
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='00a501c30d91$cf0b7740$1800a8c0@medusa' \
--to=thiagolima@webforce.com.br \
--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.