[wplug] IP forwarding with iptables?

Bill Moran wmoran at potentialtech.com
Wed Feb 11 13:10:32 EST 2004


Tim Lesher wrote:
> I'm trying to forward inbound udp traffic to a privileged port, to an
> unprivileged port on the same box.  The purpose is to let a non-suid
> daemon handle the traffic.  The environment is Debian Sarge, kernel
> version 2.4.22.
> 
> I've turned on ip_forward in /proc/..., and I've tried the following
> iptables commands:
> 
> iptables -t nat -A PREROUTING -p udp --dport 142 -j DNAT --to :8142
> 
> But I'm still getting packets on port 142, not 8142.  Any suggestions?

I'm not terribly familiar with iptables, but I've done this sort of thing
with FreeBSD's IPFW and ipf.

Something I would suggest trying it specifically forwarding the traffic
to 127.0.0.1:8142, and make sure your program is listening on the
loopback interface ... this becomes a little less ambiguous, and
(hopefully) more likely to work correctly.

-- 
Bill Moran
Potential Technologies
http://www.potentialtech.com




More information about the wplug mailing list