Yes, you can set up and connect to your own VPN from a device managed by resin.io. I’d be cautious about saying “instead of” the resin.io VPN though – this would be an additional VPN connection in parallel to the default VPN connection.
The default resin.io VPN connection is what allows you to access things on the device like logs, the terminal, real-time status (running/downloading/installing), etc. We also use it to tunnel in the Device URL if you turn that on.
So if you set up another VPN in your infrastructure somewhere, you can connect to it from the device exactly as you would if the device were not managed by Resin. It just becomes one more connection outbound from your device, but doesn’t replace the resin.io VPN.
(Having said all that, it is possible to turn off the default VPN. You lose the real-time aspects I mentioned and devices will only get updates whenever they poll, so if you set the polling interval to be very long it could be a long time before they notice a new update! But it can be useful if you have very limited connectivity, bandwidth, or power. There’s a blog post that goes over exactly how all of this works if you are interested.)
I’ll see if I can find some time to poke at this a bit and maybe provide an example. It could be useful to lots of people, I think!