Results 1 to 8 of 8

Thread: Auto connect VPN connection on Ubuntu 15.10

  1. #1
    Join Date
    Nov 2015
    Beans
    6

    Auto connect VPN connection on Ubuntu 15.10

    Hi all,

    I've migrated on Ubuntu 15.10, it's ok but my VPN connection doesn't connect automatically on boot.
    This script worked good on Ubuntu 15.04 and now, doesn't work ...

    In /etc/NetworkManager/dispatcher.d, my script name 02vpn

    Code:
    #!/bin/bash
    CON_NAME="enp2s0"
    VPN_NAME="CyberGhost-CzechRepublic"
    
    CON_STAT=$(nmcli con show --active | grep "${CON_NAME}")
    VPN_STAT=$(nmcli con show --active | grep "${VPN_NAME}")
    
    if [ ! -z "${CON_STAT}" -a -z "${VPN_STAT}" ]; then
    
        nmcli con up id "${VPN_NAME}"
     fi
    When I execute the script with command line "/etc/NetworkManager/dispatched.d/02vpn", it's works. But doesn't on boot ...
    I try to activate my script with the "Boot Application" but no success ...

    Why my script doesn't works ? How can I connect my VPN on boot ?

    Thanks you in advance and sorry for my approximative english

  2. #2
    Join Date
    Jun 2006
    Beans
    26

    Re: Auto connect VPN connection on Ubuntu 15.10

    There are a number of 'connect-*' openvpn config. options, particularly connect-retry and related options, have solved similar issues in the past for myself.

  3. #3
    Join Date
    Jun 2006
    Beans
    26

    Re: Auto connect VPN connection on Ubuntu 15.10

    Having said that that is assuming enp2s0 is actually up and running at that point (i.e., in the boot sequence).

  4. #4
    Join Date
    Nov 2015
    Beans
    6

    Re: Auto connect VPN connection on Ubuntu 15.10

    yes, the enp2s0 is up automatically on boot and normally, before the script.

    There isn't this option "connect retry" in "Advanced settings" of my VPN connection :/.

    How I can see if the script is executing before my connection ?

  5. #5
    Join Date
    Nov 2015
    Beans
    6

    Re: Auto connect VPN connection on Ubuntu 15.10

    Hi,

    I just saw my VPN connection sometimes cut and I must reconnect manually ...

  6. #6
    Join Date
    Nov 2015
    Beans
    6

    Re: Auto connect VPN connection on Ubuntu 15.10

    Anyone can help me please ?

    Anyone use a VPN with automatic connection on Ubuntu 15.10 ?
    Last edited by aurel130492; November 29th, 2015 at 06:48 PM.

  7. #7
    Join Date
    Nov 2015
    Beans
    41

    Re: Auto connect VPN connection on Ubuntu 15.10

    this is a great question I'm researching myself! I'm going to try with the upstart daemon.

  8. #8
    Join Date
    Nov 2015
    Beans
    41

    Re: Auto connect VPN connection on Ubuntu 15.10

    Quote Originally Posted by aurel130492 View Post
    Anyone can help me please ?

    Anyone use a VPN with automatic connection on Ubuntu 15.10 ?

    Yes! I found in the network configuration manager, for your wireless config you are using (not the vpn connection but the wireless connection), select the General tab and you will find a "automatically connect to a vpn connection when using this connection" option. If you select that, next time you boot your computer, before you even log in you will be prompted for the vpn password. Personally I would rather it not connect at all until I log in but then in this case I am using this as a desktop and not a server.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •