this post was submitted on 23 Apr 2024
32 points (90.0% liked)

Selfhosted

40407 readers
277 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

So..in a short sentence...the title. I have a server in a remote location which also happens to be under CGNAT. I only get to visit this location once a year at best, so if anything goes off...It stays off for the rest of that year until I can go and troubleshoot. I have a main location/home where everything works, I get a fixed IP and I can connect multiple services as desired. I'd like to make this so I could publish internal servers such as HA or similar on this remote location, and reach them in a way easy enough that I could install the apps to non-tech users and they could just use them through a normal URL. Is this possible? I already have a PiVPN running wireguard on the main location, and I just tested an LXC container from remote location, it connects via wireguard to the main location just fine, can ping/ssh machines correctly. But I can't reach this VPN-connected machine from the main location. Alternatively, I'm happy to listen to alternative solutions/ideas on how to connect this remote location to the main one somehow.

Thanks!

you are viewing a single comment's thread
view the rest of the comments
[–] redcalcium@lemmy.institute 7 points 7 months ago (1 children)

If this server is running Linux, you can use autossh to forward some ports in another server. In this example, they only use it to forward ssh port, but it can be used to forward any port you want: https://www.jeffgeerling.com/blog/2022/ssh-and-http-raspberry-pi-behind-cg-nat

[–] taladar@sh.itjust.works 3 points 7 months ago (1 children)

OpenSSH also has a built-in tunnel that is more general (-w Parameter) than just port forwarding.

[–] redcalcium@lemmy.institute 3 points 7 months ago (2 children)

Yes, but autossh will automatically try to reestablish connection when its down, which is perfect for servers behind cgnat that you can't physically access. Basically setup and forget kind of app.

[–] bri@lemmy.ml 2 points 7 months ago

You can use any ssh command option (including -w) with autossh.

-w creates tap devices on the server and client, and connects them together. Both sides get a private IP address.

[–] taladar@sh.itjust.works 1 points 7 months ago

"How I get a reliable ssh connection" and "What I do with the SSH connection once I have one" are two entirely different things, autossh does the first, my comment was about the second.