Is it possible to connect to multiple VPN networks at once via Network Manager?

Solution 1:

With 12.10 (network-manager 0.9.6), you can connect to multiple VPNs using the network settings:

  • System settings (gnome-control-center)
  • Network
  • Select each VPN and set it to "on".

You can also use the nmcli tool; see http://cweiske.de/tagebuch/networkmanager-vpn.htm for more information.

Solution 2:

This is a known limitation of network-manager-openvpn. You can subscribe to https://bugs.launchpad.net/ubuntu/+source/network-manager-openvpn/+bug/671024 and mark the bug as affecting you.

As mentioned in the first comment, it is possible to connect to multiple VPNs but not via Network Manager.

Solution 3:

It seems that what you want is not possible at the moment. There are a lot of bugs on this issue like this and it was assigned to upstream.

Even so, you can connect multiple vpns at once as described in this answer. You can write you own configuration file by reading "Manually configuring your connection" section in this Ubuntu help page.

Solution 4:

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.

  1. Connect to the first VPN using Network Manager.
  2. 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.