IPfilter
[Top] [All Lists]

Re: Need a one-armed port forwarder

To: Gary Mills <mills@cc.umanitoba.ca>, IPFilter <ipfilter@coombs.anu.edu.au>
Subject: Re: Need a one-armed port forwarder
From: Jim Sandoz <sandoz@alcatel-lucent.com>
Date: Thu, 04 Jan 2007 10:57:44 -0500
Delivered-to: sp-com-lists@consult.net
Delivered-to: ipfilter-list@securepoint.com
In-reply-to: <20070104022152.GA11019@cc.umanitoba.ca>
References: <20070104022152.GA11019@cc.umanitoba.ca>
Sender: owner-ipfilter@coombs.anu.edu.au
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.7.13) Gecko/20060414

Gary Mills wrote:
I'm using ipfilter 4.1.13 on a Solaris 9 machine that has only one
ethernet interface.  I'd like to intercept TCP packets arriving on
that interface for a specific port and redirect them to another
machine on the same network.  I only want to alter the destination
IP address, leaving the source IP address intact so that client
logging will work correctly.  I've tested a few ipfilter rules that
I expected to work, but none of them did:

        rdr hme0 0.0.0.0/0 port 23 -> xxx.yyy.16.57 port 23
        block in quick on hme0 to hme0:xxx.yyy.16.57 proto tcp from any to any 
port = 23
        block in quick on hme0 dup-to hme0:xxx.yyy.16.57 proto tcp from any to 
any port = 23

http://www.phildev.net/ipf/IPFprob.html#prob8

I've since read that this is impossible, because the kernel can't route
a packet back to the interface on which it just arrived.

if the kernel can't or doesn't want to do it, get a userland
program to do it.
e.g.
http://marc.theaimsgroup.com/?l=ipfilter&w=2&r=1&s=bounce&q=b
leads to
http://marc.theaimsgroup.com/?l=ipfilter&m=105309920505392&w=2
leading to things like
http://www.freshports.org/net/bounce
http://gatekeeper.dec.com/pub/BSD/NetBSD/NetBSD-current/pkgsrc/net/bounce/README.html
and even
http://locutus.kingwoodcable.com/jfd/java/tcp/tcp.html

> Is there really
no way to accomplish this with ipfilter?  It seems so simple!

though it may be simple it is not a function of ipfilter.

jim


<Prev in Thread] Current Thread [Next in Thread>