Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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.

share|improve this question

4 Answers 4

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.

share|improve this answer
    
Thanks. This works. –  Christopher Pfohl Dec 19 '13 at 20:14

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.

share|improve this answer

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.

share|improve this answer

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.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.