GlobalProtect-openconnect
GlobalProtect-openconnect copied to clipboard
Feature request: Add option local network routes / custom routes
I would like to have the option to use the vpn connection only for resources of its connections and also to be able to give some custom routes if needed. Is it possible to do it in the gui tool?
If you want you can guide me to the code to see if i can write this part of code.
Thanks panos
Probably duplicated with #164
I think https://github.com/dlenski/vpn-slice is the tool to address this problem. You can configure that VPNC script in GUI.
does cli version support this?
I couldn't find if the cli version supports specifying a custom script, so I just put one in
/usr/local/sbin/vpnc-script that is used before /usr/share/vpnc-scripts/vpnc-script
https://github.com/yuezk/GlobalProtect-openconnect/blob/fe3d3df662117ca45c7b2a5cf3d94b215044675a/crates/common/src/vpn_utils.rs#L5
My script then invokes vpn-slice (which I installed in a venv)
#!/bin/bash
/home/luca/vpn/venv/bin/vpn-slice -v the.host.I.need.com >> /tmp/vpncscript 2>&1
Mmh, I feel stupid now:
$ gpclient help connect
Connect to a portal server
Usage: gpclient connect [OPTIONS] <SERVER>
Arguments:
<SERVER> The portal server to connect to
Options:
-g, --gateway <GATEWAY>
The gateway to connect to, it will prompt if not specified
-u, --user <USER>
The username to use, it will prompt if not specified
--passwd-on-stdin
Read the password from standard input
--cookie-on-stdin
Read the cookie from standard input
-s, --script <SCRIPT>
The VPNC script to use
-s, --script
Tracked in #25