I want to make an SSH connection
e.g ssh [email protected] -p 22
SSH connection can only be made when connected to VPN tunnel. I can connect to VPN tunnel like this
echo PASS | sudo openconnect --juniper https:/example/ -u user --passwd-on-stdin
Now the SSH connection works!
BUT
When I'm connected to the tunnel it changes my public IP 176.234.123.12 to 10.13.25.1. Because of that my web server dosen't work. Because it routes all the traffic trough tunnel.
I want to send SSH command through VPN connection, but I don't want my VPN to route all the traffic.
How can I do this?
What I tried so far
I tried to make an bash script that connects to the network and then sends ssh command and after that disconnects, but thats really bad solution.
Also tried openSSH ProxyCommand, but I think misunderstood that
ssh -o ProxyCommand="echo PASS | sudo openconnect --juniper https://example/ -u user --passwd-on-stdin" user@host
I saw post about openVPN using route-nopull
But I'm not sure how to redirect traffic with OpenConnect