Add something like the following to your client.conf file:
script-security 2 # run /etc/openvpn/up.sh when the connection is set up up /etc/openvpn/up.sh
Obviously, up.sh must be executable. Also, if you expect the command to fail but still want Openvpn to start correctly (it will die if the script returns anything other than 0), then tack on an “exit 0? at the end of your script.
Thx to askubuntu.