I have a Linux machine on the intranet which I can only access via SSH. This machine needs to connect to a VPN using OpenConnect; however when I do that, I get disconnected from the SSH session since the intranet's IP is no longer valid.
I can reconnect to it from within the VPN using the IP it got assigned, but that IP changes every time the VPN is connected. I don't have control over any of the networks, only this machine.
Is there a way to keep the SSH connection alive while connecting to the VPN?
openconnect
requires a --script
argument which takes a script to configure routing. Without it the connection succeeds, but no names are resolved and the intranet's IP remains valid.
I'm currently using Ubuntu's default /etc/vpnc/vpnc-script. I'm good with shell scripting but I know very little about networking. If I have to modify that, I'll need some reference about what or how to change it.
openconnect
but "I get disconnected from ssh since the intranet's IP is no longer valid" doesn't make sense to me. You have to find out what exactly is happening there. Maybeopenconnect
reconfigures the firewall. Is the intranet IP the only IP this system has (except forlo
)?iptables
.openconnect
command takes a--script
argument which takes a vpnc-script which configures routing, without it the connection suceeds but no names can be resolved, I don't lose the intranet's IP if I don't use that script but the connection is useless without it; I'm currently using/etc/vpnc/vpnc-script
in Ubuntu, chances are I'll have to tweak it but I need some pointers about what and how to chage.