Jenkins job using VPN? Is there a way to connect to a VPN for the duration of a Jenkins job? (freestyle or pipeline, I can work with either). 

I scoured the plugin list figuring someone might have developed something, but the only page found was this OpenConnect page with no actual code developed, so that seems to be out. 

We're running Jenkins on Ubuntu AWS boxes, if that changes anything. I'd prefer the ability to connect and disconnect in a single job, rather than making everything run on VPN.
I think that it's very difficult, if not impossible, to achieve something like this. 

The reason is that once the machine running Jenkins is connected to the VPN it is also effectively disconnected from the original network it was connected to, which means Jenkins on that machine will loose connection with the rest of your Jenkins setup.

The only way that might work would be if using completely standalone one-machine Jenkins setups.