GlobalProtect-openconnect icon indicating copy to clipboard operation
GlobalProtect-openconnect copied to clipboard

Feature request: Add option local network routes / custom routes

Open ptsiamis opened this issue 1 year ago • 5 comments

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

ptsiamis avatar Oct 03 '24 14:10 ptsiamis

Probably duplicated with #164

jerome-pouiller avatar Oct 15 '24 08:10 jerome-pouiller

I think https://github.com/dlenski/vpn-slice is the tool to address this problem. You can configure that VPNC script in GUI.

yuezk avatar Nov 02 '24 13:11 yuezk

does cli version support this?

divansantana avatar Feb 27 '25 13:02 divansantana

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

olivluca avatar Mar 14 '25 14:03 olivluca

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

olivluca avatar Mar 14 '25 16:03 olivluca

Tracked in #25

yuezk avatar Nov 25 '25 15:11 yuezk