In message <dj0e0c$8vi$(E-Mail Removed)>, Lutz Brödel
wrote:
>
> #allow all outgoing traffic from the web server
> iptables -t nat -A POSTROUTING -o $PUBLIC_IF \
> -d 192.168.1.2 -p tcp --dport 1080 \
> -j SNAT --to 192.168.1.1
>
I don't like this one. Looking at what I had in the past, I've got this lot
which allows general access.
$IPTABLES -A FORWARD -i $EXTIF -o $INTIF -p tcp --dport 80 -m state \
--state NEW,ESTABLISHED,RELATED -j ACCEPT
$IPTABLES -A PREROUTING -t nat -p tcp -d $EXTIP --dport 80 \
-j DNAT --to 192.168.1.18:80
$IPTABLES -t nat -A POSTROUTING -o $EXTIF -j SNAT --to $EXTIP
If you swap the dport from 80 to 1080, $EXTIF is the external port (eth1),
$INTIF is the internal port (eth0). $EXTIP is the IP address of the
external interface.
I don't see why you need to restrict access to local IP addresses only, the
port forwarding with address rewriting makes you just as vulnerable as
letting them in without the rewrite.
--
Dave
mail da
(E-Mail Removed) (without the space)
http://www.llondel.org/
So many gadgets, so little time...