Hi again. I hope it's not unwelcome to ask a pf question here; I hope
this one isn't too elementary.

I have a daemon that sends and receives UDP packets on port 1337. For
reasons, I would like to use pf on my computer (i.e. the one that's
running the daemon) to take the daemon's outbound UDP packets, which it's
emitting from port 1337, and actually send them out to the internet as
if they're coming from port 31337. Also, I'd like UDP packets coming in
to port 31337 to be received by the daemon, which is listening for them
on port 1337. In ASCII art, that's:

                            .    .         |
   +-------+                  o * . ~ *    |
   |   my  |--> UDP 1337 --> % . pf  : . --|--> UDP 31337 -->  clouds
   |special|               + .  magic  +   |                    and
   |daemon |<-- UDP 1337 <--  * _  , +  <--|--- UDP 31337 <--  stuff
   +-------+                 + * o .  ~    |
                                           |
           INSIDE MY OPENBSD MACHINE       |    OUT ON THE INTERNET
                                           |

All IP addresses involved should remain the same throughout, and in that
way this feels a little bit different to NAT: there's no address
translation since the addresses do not change. Does anyone know if it's
possible to get pf to do this?

Search engines have not helped me out with this one, but my search skills
were dubious even before the AI era.

If not pf, maybe relayd would work? I worry that its extra layer of
indirection might be slow, and I'd like this process to be as fast as it
can be.

Thanks for any tips!
--T

Reply via email to