I want to make an SSH connection
ssh email@example.com -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!
When I'm connected to the tunnel it changes my public IP 184.108.40.206 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
But I'm not sure how to redirect traffic with OpenConnect