I live in a country where wireguard, openvpn and other vpn protocols have been blocked. Tailscale and Cloudflare Tunnels don’t wok either. I do have a public ip and my router supports DMZ and port forwarding. For security concerns I’m not willing to forward ports. Is there any other method to use my VPS to forward traffic to my home server?

  • zikk_transport2@lemmy.world
    link
    fedilink
    English
    arrow-up
    1
    ·
    1 year ago

    Some time ago I’ve done a “public IP implementation” on my VPS when I was on mobile network (no public IP).

    Basically set up IPSec/Wireguard on VPS and connect your router to it. Then setup EoIP over VPN between VPS and your router. Then add EoIP tunnel to your LAN’s bridge in your router.

    Then setup all ports forwarding (using iptables) from your VPS to your router on LAN, so if you connect to your VPS using tcp80, it will be simply forwarded (NAT’ed) to your router. Except tcp22, for SSH to your VPS obviously…

    And now you have yet another public IP lol.

    This is not something you asked, but might give you some ideas.

    • humanreader@infosec.pub
      link
      fedilink
      English
      arrow-up
      0
      ·
      edit-2
      1 year ago

      So that setup effectively gives you an all-ports available connection (except 22) from your mobile device and anything that connects through it, like a laptop? The exit node would be the VPS.

      Could I skip the home router and EoIP+VPN directly between mobile and VPS, for instance?

      I am in a situation (restrictive firewall on ethernet/wifi, prefer personal mobile connection but it’s cgnat or something equally crap) this could be very useful for me.

      • zikk_transport2@lemmy.world
        link
        fedilink
        English
        arrow-up
        1
        ·
        1 year ago

        Technically like this:

        Anyone -tcp80-> vps -tcp80-> router -tcp80-> homeserver.

        Exit of homeserver-originated traffic would be your router, not vps. Unless you specify custom routes in your router, then yeah, might be possible.

        Also you don’t need EoIP tunnel at all, since it’s all in Layer4.