Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 17 Oct 2017 15:18:40 +0200
From:      "Kristof Provost" <kristof@sigsegv.be>
To:        "no@spam@mgedv.net" <nospam@mgedv.net>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: pf/nat guru needed: fwd of packet to 255.255.255.255
Message-ID:  <DD63DF02-3DED-4B71-9BC6-5DAD913EBFAF@sigsegv.be>
In-Reply-To: <002101d346c0$65ef67d0$31ce3770$@mgedv.net>
References:  <002101d346c0$65ef67d0$31ce3770$@mgedv.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On 16 Oct 2017, at 22:50, no@spam@mgedv.net wrote:
> hi folks,
>
> short: anyone out there knows, how to redir & forward packets to
> 255.255.255.255?
>
> preface: i need to get a crappy, stupid, very (!) wrong programmed 
> device
> running.
> and i know this crapdev violates RFCs, so this is the wrong story for 
> RTFM
> hints ;)
>
> the BSD box setup:
> freebsd 11.1, amd64.
> - interface "A": 10.10.21.1/24, MTU1500
> - interface "B": 10.10.22.1/24, MTU1500
>
> the (crapdev) source generates an ipv4 UDP packet as follows:
> - source address 10.10.21.11, port >1023
> - target hw addr: ff:ff:ff:ff:ff:ff
> - target ipv4 addr: 255.255.255.255 port 4444
> - payload ~ 500 bytes, so it fits inside 1 packet.
>
I would not be surprised if that packet also has a TTL of 1.
In fact, I’d consider it a bug if it had a different value.

You could probably set a scrub rule to change it, so the packet can be 
forwarded, but I’d be very tempted to just run a proxy for this, 
rather than trying to fix it with pf.
It might even be possible to get the appropriate socat incantation to do 
it, so maybe you don’t even need to write any code for this.

Regards,
Kristof



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?DD63DF02-3DED-4B71-9BC6-5DAD913EBFAF>