16

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

I am running Ubuntu 12.04.1 LTS.

For now I am only able to switch between preconfigured VPN connections. It`s quite annoying as I need to be connected to two or more VPN networks simultaneously.

For example on Windows OpenVPN clients, it is possible.

4 Answers 4

12

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.

2
  • 4
    This causes my first VPN connection get dropped. As @Simon Déziel have mentioned this looks like to be a kind of bug.
    – frogatto
    Mar 16, 2015 at 9:38
  • I think this only works if the VPN connections use different providers. e.g. not both Cisco vpnc connctions. I've even had cases where VPN using a given provider just broke and refused to reconnect until I rebooted when I tried this.
    – Adrian
    Feb 23, 2016 at 17:17
5

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.

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.

3

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .