Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 21 Nov 2002 14:07:45 -0500
From:      Scot Loach <sloach@SANDVINE.com>
To:        'Martin Stiemerling' <Martin.Stiemerling@ccrle.nec.de>, Scot Loach <sloach@SANDVINE.com>
Cc:        "'freebsd-net@freebsd.org'" <freebsd-net@FreeBSD.ORG>
Subject:   RE: Using ipfw to forward udp
Message-ID:  <FE045D4D9F7AED4CBFF1B3B813C85337E5F45C@mail.sandvine.com>

next in thread | raw e-mail | index | archive | help
According to the manual text quoted below, in my example the ipaddr is
localhost and the port is 9000.

So all UDP packets (matching packets) should be forwarded to 9000 (port) on
the local machine.

What I'm seeing is that no packets are forwarded to port 9000, and I only
receive packets that were originally sent with a destination port of 9000.

scot.


-----Original Message-----
From: Martin Stiemerling [mailto:Martin.Stiemerling@ccrle.nec.de]
Sent: Thursday, November 21, 2002 2:03 PM
To: Scot Loach
Cc: 'freebsd-net@freebsd.org'
Subject: Re: Using ipfw to forward udp



man ipfw says to fwd:
  fwd | forward ipaddr[,port]
Change the next-hop on matching packets to ipaddr, which can be
an IP address in dotted quad or a host name.  The search termi-
nates if this rule matches.
If ipaddr is a local address, then matching packets will be for-
warded to port (or the port number in the packet if one is not
specified in the rule) on the local machine.
If ipaddr is not a local address, then the port number (if speci-
fied) is ignored, and the packet will be forwarded to the remote
[...]

This is exactly the behaviour you're describing. May be the divert is 
more appropriate for your needs.

Martin


Scot Loach wrote:
> I'm trying to implement a type of transparent proxy for UDP.  My idea was
to
> use ipfw to redirect all incoming UDP packets to my server, for example:
> 
> ipfw add fwd 127.0.0.1,9000 udp from any to any recv em0
> 
> However this doesn't seem to work: my server only receives UDP packets
that
> are addressed to port 9000.
> 
> Can anyone suggest what I might be doing wrong?
> 
> thanks
> 
> scot.
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-net" in the body of the message



-- 
Martin Stiemerling

NEC Europe Ltd. -- Network Laboratories  Stiemerling@ccrle.nec.de
IPv4: http://www.ccrle.nec.de  IPv6: http://www.ipv6.ccrle.nec.de

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-net" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?FE045D4D9F7AED4CBFF1B3B813C85337E5F45C>