You can't do it with Network Manager, but yes, using Network Manager and pptp.
Here is how I make it works in my case.
- Connect to the first VPN using Network Manager.
- Connect to the second VPN with command
pon vpn2
, use poff vpn2
to disconect the second VPN.
To make the command pon
works, you will need to create the followed files in your system:
file /etc/ppp/peers/vpn2
:
pty "pptp VPNIpAddress --nolaunchpppd"
name YourUsername
remotename PPTP
require-mppe-128
file /etc/ppp/options.pptp
ipparam vdc
file /etc/ppp/options.pptp
:
lock
noauth
refuse-pap
refuse-eap
refuse-chap
refuse-mschap
nobsdcomp
nodeflate
Of course the content of these files is depends on your VPN servers.
In my case I also should to add the ip-up.d/ rules, to add the necessary routes.
file /etc/ppp/ip-up.d/vpn2
#!/bin/bash
case "$PPP_REMOTE" in
YourVPNGatewayIPHere)
route add ....
route add ....
...
;;
*)
esac
Don't forget: sudo chmod +x /etc/ppp/ip-up.d/vpn2
Also you will need to edit the file /etc/ppp/chap-secrets
and add there your credentials.
After this, connecting to VPN1 with Network Manager, run:
sudo pon vpn2
Check syslog if something goes wrong.