Net Hosting Talk

We are a community of individuals and businesses passionate about web hosting. Let's build, learn, and grow together.

Help SSH connection problem with VPN

Antoniovnp

New Arrival
Registered
Hi,

I'm a Tmux user, but when I launch my VPN connection command on my VPS, I lose the SSH connection in a Tmux session because my computer can't communicate with the VPS as its IP changes.

Thanks
 
  • Advertisement
  • Then connect to the new IP and attach your session to the already running tmux session. Maybe you can hack with Autossh or a similar tool, but I assume it should go with the manual approach if you switch sporadically between VPN and no VPN.
     
  • Advertisement
  • Classic move - Tmux won't save you when the network vanishes. The moment your VPS switches default route over the tunnel, your SSH dies because the return path is gone. Tmux keeps running on the server, but you can't reach it. Don’t route the default gateway through the VPN unless you have to. Use policy routing or split tunneling so only specific traffic goes through the tunnel - leave SSH on the public interface. What kind of VPN are you running? WireGuard, OpenVPN, or a provider setup? That changes how easy it is to fix.
     

    Advertisement

    Back
    Top