This is rather easy. Follow these steps
# pkg_add vpnc
If you have a pcf file from your university or whatever, convert it to vpnc format using this script here.
Some commands will not be recognised, depending on your version. Remove them.
My final file.vpnc file looks like this
$ cat ~/fitx_confg/vpn/UPV/UPV.vpnc IKE Authmode psk IPSec gateway vpn.upv.es IPSec ID soloupv IPSec secret password_corresponding_to_IPSec_ID Xauth username my_user_name_on_the_vpn_domain Xauth password my_password_on_that_vpn_domain
Then add yourself to the doas config file to be able to use it
permit nopass :pau cmd vpnc
And start it
$ vpnc ~/fitx_confg/vpn/UPV/UPV.vpnc
The programme gives us the pid of the process when it starts, so that to stop it we simply kill -9 it.