Cloud IP to Onsite IP

I would like to purchase an public IP say from Linode and then route than IP back to my homelab. Does anyone know the best way to do this and maybe an how to guide?

I don’t have a guide, per se, but you’d:

  • set up your DNS records to point at the Linode VPS
  • connect a VPN (WireGuard, for example) between the VPS and your home network
  • set up a reverse proxy at the VPS to direct traffic to your home server based on its subdomain
  • bonus: configure the VPN to route traffic to your homeland for those using VPN connections (how will differ a little based on which VPN you use)

Gotcha, wasn’t sure if it would be better using BGP Routing.

I don’t know how BGP would play into this. It’s used to connect autonomous systems together, which is not what you’re trying to achieve.

A HTTP reverse proxy is a simple way if all you care about is making websites accessible. Apart from that, you’ll be looking at some sort of NAT (specifically destination NAT, i.e. port forwarding) which you can use to forward traffic coming in on a specific port on the VPS to a port on a machine on the other end of a VPN tunnel between the VPS and your home network.

What you are describing could also be a Cloudflare tunnel. I get a public Cloudflare IP address and the tunnel (cloudflard running in a docker container) does all of the encryption and routing of the traffic from Cloudflare to my home lab. With a Cloudflare tunnel, I can selectively decide which services to publish via the cloud IP, I do not have to run all of my traffic through the cloud IP.

You could also do something similar with Tailscale which uses the Wireguard protocol but makes configuration and management dead simple.

If you do a VPN (e.g. wireguard) or an overlay network (e.g. Tailscale) then you will also need to pay for a VPS on the cloud to run those software packages. With Cloudflare, their tunnels are completely free

3 Likes