[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Port forwarding with ipmasq and iptables


I'm running debian woody on my gateway with the ipmasq package installed
and I need to do some port forwarding to a machine on my LAN. So I
created a file /etc/ipmasq/rules/F10portf.rul

ipnm_cache ppp0

$IPTABLES -A PREROUTING -t nat -p tcp -d $IPOFIF --dport <port> -j DNAT

$IPTABLES -A FORWARD -p tcp -d $IPOFIF --dport <port> -m sate --state

where <port> is the number of the port that needs to be forwarded, ppp0
is my external interface and is the machine on the LAN that
needs to have the port forwarded to it. From the gateway I can connect
to on port <port>. What's wrong with my rules? I haven't
changed anything about the default ipmasq setup (after the debconf
questions) other than adding that .rul file. Using iptables -L and
iptables -t nat -L I can see that these rules are being added to their
respective chains without issue.

Thanks in advance for any help.

Reply to: