In past I've connected to VPN via Linux in Windows perfectly with python by using the following code:
import win32ras
hdl, retcode = win32ras.Dial (None, None, (vpn_name, ip, "", username, password, ""), None) #changing 'ip' will connect to that server ip
win32ras.HangUp (hdl) #This disconnects the connection
So this works perfectly fine in windows with python but now I want to do it in ubuntu with python and I'm not sure how to do this at all. I want to do the same, define a VPN name and change its IP on connecting and input via username/password, if there's any other way, like directly connecting to the VPN without even making one then that's obviously better.
I'm finding the solution on internet as of now, will update if I find something.