Dnia 10 grudnia 2021 09:49:08 CET, Claus Assmann <ca+openbsd_m...@esmtp.org> 
napisał/a:
>I am trying to run an SMTP server on a dynamic IP address
>(and maybe other services later on, e.g., DNS or HTTP)
>
>For this, I would like to redirect traffic via a host (STATIC) which
>has a static IP address to/from the host (DYNAMIC) with the dynamic IP
>address.
>
>To route the port incoming it seems I can use:
>DYNAMIC$ ssh -o ExitOnForwardFailure=yes -N -R 25:localhost:25 STATIC
>
>This also has the advantage that the routing is only active
>as long as DYNAMIC is up and running with the same IP.
>
>So far I haven't found a way to route outgoing SMTP from DYNAMIC
>via STATIC; I don't want to send mail directly from DYNAMIC as many
>MTAs block traffic from dynamic IPs.
>
>What is a good way to do this?
>Could route with -T table option or
>one of pf features rdr-to or nat-to be used?
>Since DYNAMIC is behind some gateway and has only a local IP address
>provided by DHCP this doesn't seem to be possible?
>Moreover, the routing needs to be disabled whenever DYNAMIC is
>"down" (to avoid potential abuse by whatever host is getting the
>IP address DYNAMIC had).
>
>I hope this makes sense - maybe I'm missing some simple solution?
>
>PS: I could use SMTP relaying: run an MTA on STATIC but then the
>mail could get queued there (which I want to avoid for many reasons).

I'd run full tunnel VPN on STATIC, and connect to it from DYNAMIC. Then, entire 
traffic from DYNAMIC goes via STATIC, and you can DNAT any port you want.

Maybe this is not exactly what you are looking for, but I think it's the 
simplest way.

Kind regards
--
Łukasz Moskała

Reply via email to