do you mean via in terms of routing (juts fetch the packages via the opnvpn interface in question) or in terms off accessing the opnsense device only from that interface?
So you need a route for the pkg mirror. Steps:configure the desired openvpn interface (if not yet done) iface->assignements + iface configconfigure a gateway on the ovpn interface choose a fixed mirror (on that that is not resolving to multiple IP addresses in different networks)create a route matching the mirror address and choosing the crfeated opvn gateway
Fetching changelog information, please wait... SSL certificate subject doesn't match host 178.162.136.178fetch: https://178.162.136.178/${SUBSCRIPTION}/FreeBSD:12:amd64/21.7/sets/changelog.txz.sig: Authentication errorUpdating OPNsense repository catalogue...SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178pkg: https://178.162.136.178/${SUBSCRIPTION}/FreeBSD:12:amd64/21.7/latest/meta.txz: Authentication errorrepository OPNsense has no meta file, using default settingsSSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178SSL certificate subject doesn't match host 178.162.136.178pkg: https://178.162.136.178/${SUBSCRIPTION}/FreeBSD:12:amd64/21.7/latest/packagesite.txz: Authentication errorUnable to update repository OPNsenseError updating repositories!pkg: Repository OPNsense cannot be opened. 'pkg update' requiredChecking integrity... done (0 conflicting)Your packages are up to date.***DONE***
Don't set the IP of the mirror. Set the mirror the regular way, but lookup the IP and route the IP through your VPN tunnel. That's all.
May I ask WHY you want to do this?
And I honestly don't get your privacy concerns.