Skip to contentSkip to conversation

need assistence for PREROUTING

DISCUSSION Jochen Kaechelin 2 participants 2 messages Jul 10, 2006

lore
Share & tools
lore
#0 lore raw

I have a webserver/firewall behind a dsl-router.
The router opens port 80,...,...,4444.

machine 1:  192.168.178.112 + Firewall + Webserver Port 80, 1 Nic
machine 2:  192.168.178.32  + Webserver Port 80, 1 Nic

Now i want machine 1 to redirect all requests on Port 4444 to Port 80 machine 2.

The following does not work:

$IPTABLES -t nat -A PREROUTING -i $ETH -p tcp --sport $UNPRIVPORTS --dport 4444 -d xxx.xxx.xxx.xxx -j DNAT --t o-destination 192.168.178.32

$IPTABLES -A FORWARD -i $ETH -o $ETH --p tcp --sport $UNPRIVPORTS -d 192.168.178.32 --dport 80 -m state --state NEW -j
ACCEPT

$IPTABLES -A FORWARD -i $ETH -o $ETH -m state --state ETABLISHED,RELATED -j ACCEPT

Any hints?

Thanx.

Signature · 3 lines
Jochen Kaechelin, fvgi242ss, wlanhacking.de
http://mail.wlanhacking.de/cgi-bin/mailman/listinfo
http://www.gissmoh.de - Mein sonstiges Leben!!
#1 lore raw
Quoted 3 lines

$IPTABLES -t nat -A PREROUTING -i $ETH -p tcp --sport $UNPRIVPORTS --dport 4444 -d xxx.xxx.xxx.xxx -j DNAT --t o-destination 192.168.178.32

You need port here !!! --to-destination 192.168.178.32:80

Regards,

Edvin Seferovic