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?