[plug] Port forwarding with Iptables
Paul Dean
paul at thecave.cantech.net.au
Thu Oct 31 18:43:03 WST 2002
Hya,
You need to put a forwarding rule in your FORWARD filter;
/sbin/iptables -t nat -A PREROUTING -i ppp0 \
-p tcp -m tcp --dport 4660-4670 -j DNAT --to 192.168.1.2
/sbin/iptables -A FORWARD -d 192.168.1.2 -i ppp0 \
-p tcp -m tcp --dport 4660-4670 -j ACCEPT
and if you need udp the same for those too.(I think you won't need udp
for eDonkey)
I have taken the assumption that you wish to forward this port out via
your ppp connection, as you're not giving and source or destination.
You must forward to your firewall then nat takes care of the incoming
connection, once estabished all other packets are routed accoringly.
Hope this helps...
On Thu, 31 Oct 2002, Nigel Duff wrote:
>
> Hi all,
>
> I am trying to forward edonkey ports from my firewall to a machine on my
> internal network. I have played with different configurations but can't
> get it to work. I have the following policy under a 2.4.19 kernal.
>
> iptables -t nat -A PREROUTING -p tcp -s 0/0 -d 0/0 --destination-port
> 4660:4670 -j DNAT --to-destination 192.168.1.2:4660-4670
>
> With a similar entry for UDP.
>
> Can anyone point out me in the direction of my obvious mistake?
>
> Thanks
>
> Nigel
>
>
--
Paul...
/***** Experience is that marvelous thing that enables you to
recognize a mistake when you make it again.
-- Franklin P. Jones *****/
/*****All programmers are playwrights and all computers are lousy actors.
-- Unknown*****/
/* How smart are Computers? They seem to need instructions all the time...
-- Me */
More information about the plug
mailing list