I have set up my router on my local network to use dynamic dns (no-ip) to get a "static" hostname. I have forwarded port 22 to my local pc and I can remotely log into it using ssh.
I also need the machine to connect to a vpn network to reach servers that I have to work with.
Unfortunately, as soon as I start vpn, I get disconnected and can no longer re-connect using the static hostname. I can still ping the hostname, since the router will answer, but I can not ssh to the machine I need to reach anymore.
ssh: connect to host myhostname.no-ip.biz port 22: Connection timed out
I am using vpnc to connect to the vpn, however, it is a custom build provided by my university. They state that the usual vpnc client is not compatible.
They also provide a configuration file which looks like this
IPSec gateway vpn.uni-mannheim.de
IPSec ID doniluma
IPSec secret wlan
IKE Authmode hybrid
CA-File uni-ma.pem
Xauth username myusername
And a certificate file.
Is there a possibility to adjust routing or similar, so I can (re)connect after initialising the vpn with vpnc-connect ?
Best Answer
From the VPNC man page:
So your traffic is likely being directed to your university, and if they have a restrictive firewall port 22 could be closed outside. So either you ask your network administrators to change VPN server settings in order not to set the default route for the connection or you have to change the behavior of your client. Apparently there's no option to do so (or at least I didn't spot it), but I found a workaround here. Make a copy of /etc/vpnc/vpnc-script and edit the original file. In my version I have two declarations of
set_default_route()
function. You have to change them in order not to change the default route. The first should look like this:and the second
Beware, I didn't test those modifications, so you may need to change them a bit.