Route other instances traffic through vpn instance network

Hello,

I have installed VPN app on one of the lxc instance. Now I need some of instances to use that network traffic so I can have vpn connected on oci’s and also in other lxc instances.
Within docker this option is doable via network_mode: "container:containerName". But how would this be done with incus.
So far, I tried creating a new bridged network and added ipv4.gateway to match instance’s IP address but that didn’t work as then I do not have internet connectivity in instances using that bridge.
Is this possible via incus networking? If so how?

Thanks

I don’t think you need all the trouble, if your vpn offer http proxy, other instances can just use it by

# http/https
export http_proxy="http://xx.xx.xx.xx:yyyy/"
export https_proxy="http://xx.xx.xx.xx:yyyy/"

# For curl
export HTTP_PROXY="http://xx.xx.xx.xx:yyyy/"
export HTTPS_PROXY="http://xx.xx.xx.xx:yyyy/"

If your vpn doesn’t, setup a proxy server.