2

Note: This is not the same as another question with similar title (How can you automatically run a script after connecting to a VPN on OS X?). This question is specifically asking for clarification on one of the answers there.

The answer suggests using ip-up and ip-down script in /etc/ppp. However, maybe because of a change in newer versions of OS X / macOS, or maybe because Cisco IPSEC VPNs are different, this does not work with this type of VPN.

A further requirement would be for the script to be run with root privileges, so probably something that is called by the VPN process itself.

Is there some other way to run a connect and disconnect hook script with Cisco IPSEC VPN via the native client on macOS Monterey?

najel
  • 144
  • 2
  • 12

2 Answers2

0

You may possibly be better served by setting up the Cisco VPN Client to start on boot and tying the script to user login, unless the script is directly related to some activity tied to the VPN being established. Someone with more knowledge than I have about MacOS can surely help you with this, but just wanted to get you thinking in a different direction if possible.

0

I have absolutely no clue about MacOS or Cisco (or Cisco software). However, I have encountered similar situations under various other operating systems / with various other software and therefore perhaps can give a general advice:

In most cases, VPN clients (native or from third parties) can be operated not only via GUI, but by command line as well. Hence, my solution usually was to write a script which first establishes the VPN (using the command line interface of the VPN software) and then performs further tasks as needed.

In your case, there might be a problem if the script needs root access. As mentioned above, I have no clue about MacOS, but as far as I can remember, MacOS is Unix-like, so it may be possible to enable normal users to become root when running that script (chances are that MacOS provides something like the sudo mechanism in Linux).

Binarus
  • 2,039
  • 14
  • 27