Results 1 to 9 of 9

Thread: OpenVPN connection won't start through Network Manager

  1. #1
    Join Date
    2013-Apr
    Location
    London
    Posts
    10

    OpenVPN connection won't start through Network Manager

    Good afternoon.

    I have started using Kali just recently and I was wondering if someone is having similar problem. I'm running 1.0.5 amd64 Kali. I have installed OpenVpn network manager and OpenVpn network manager-gnome, sucesfully imported the vpn settings and cerfificates, but if I start to run VPN from network interface nothing will happen. Doesn't react at all.

    If I do it through terminal it starts normally without any troubles, but I'd rather have it automatically starting when my computer starts as was happening with my previous distros.

    Is there an error with Gnome Network manager maybe?
    Thanks for any advice.

  2. #2
    Join Date
    2013-Sep
    Posts
    7
    Quote Originally Posted by bluudz View Post
    Good afternoon.

    I have started using Kali just recently and I was wondering if someone is having similar problem. I'm running 1.0.5 amd64 Kali. I have installed OpenVpn network manager and OpenVpn network manager-gnome, sucesfully imported the vpn settings and cerfificates, but if I start to run VPN from network interface nothing will happen. Doesn't react at all.

    If I do it through terminal it starts normally without any troubles, but I'd rather have it automatically starting when my computer starts as was happening with my previous distros.

    Is there an error with Gnome Network manager maybe?
    Thanks for any advice.
    Have you tried to edit the /etc/network/interfaces file and the /etc/NetworkManager/NetworkManager.conf file? Edit /etc/network/interfaces and put a '#' in front of everything except these lines:

    auto lo
    iface lo inet loopback

    (Be sure you have 'auto lo' on a line by it self, above 'iface lo inet loopback')
    Your /etc/network/interfaces file should look something like this after (except yours might say wlan0 or wlan1 instead of eth0):

    # This file describes the network interfaces available on your system
    # and how to activate them. For more information, see interfaces(5).

    # The loopback network interface
    auto lo
    iface lo inet loopback

    # The primary network interface
    #allow-hotplug eth0
    #iface eth0 inet dhcp


    You may also want to edit the /etc/NetworkManager/NetworkManager.conf file. Under '[ifupdown]' change the value for 'managed' from 'false' to 'true'.
    After you edit the file, the /etcNetworkManager/NetworkManager.conf should look something like this:

    [main]
    plugins=ifupdown,keyfile

    [ifupdown]
    managed=true

    Note: Before editing either file, you might want to backup the original files first. Open a terminal and type the following lines:
    cp /etc/network/interfaces /etc/network/interfaces.backup
    cp /etc/NetworkManager/NetworkManager.conf /etc/NetworkManager/NetworkManager.confBackup
    Not sure if it will work, but worth a try..

  3. #3
    Join Date
    2013-Jul
    Posts
    42
    Checked out the Server forums for any similiar problems with Openvpn. found this
    http://superuser.com/questions/28486...ager-in-debian

    Secondly I found this - which looks promising
    http://fooninja.net/2012/09/06/openv...nager-problem/

    I installed and configured the OpenVPN client/server on a Debian box as per Linode’s instructions (same for Ubuntu). One gotcha was that while it worked fine when starting OpenVPN manually on the client machine (/etc/init.d/openvpn start, Ubuntu 12.04.1), starting it from Network Manager made it connect but appear not to work. I found that I had to enable LZO compression in the Network Manager settings:
    VPN connections -> Configure VPN -> select configured VPN and edit -> VPN tab -> Advanced. Check “Use LZO data compression”.
    (Oh, and if you don’t see OpenVPN in the “Choose a VPN Connection Type” dropdown, make sure you’ve installed both network-manager-openvpn and network-manager-openvpn-gnome.)
    Last edited by uwnthesis; 2013-09-14 at 18:42.

  4. #4
    Join Date
    2013-Apr
    Location
    London
    Posts
    10
    It did work well. Thank you very much!

    One more thing I'm thinking about now while we are in the topic. Is it possible to set it up so VPN would connect automatically after system boot?

  5. #5
    Join Date
    2013-Jul
    Posts
    42
    Quote Originally Posted by bluudz View Post
    It did work well. Thank you very much!

    One more thing I'm thinking about now while we are in the topic. Is it possible to set it up so VPN would connect automatically after system boot?
    There looks to be an "official" Debian way of doing this, and an unofficial hack. This should help you:

    http://serverfault.com/questions/458591/how-to-auto-start-openvpn-client-on-ubuntu-12-04-cli


    On Ubuntu any VPN configuration you place in a file named /etc/openvpn/$NAME.conf will be automatically started.
    So, all you have to do is copy your client.ovpn to /etc/openvpn/client.conf. I suggest you also use absolute paths in your client.conf for any keys, scripts and so on.
    Of course, you might want to double check the /etc/default/openvpn file.
    By default it will autostart all VPNs, but the AUTOSTART value could have been changed to none, or to be a list of the specific configurations you want automatically started.

    The Hacked method
    http://www.hackerway.ch/2012/12/11/h...04/#comment-79




    Good luck!

  6. #6
    Join Date
    2013-Apr
    Location
    London
    Posts
    10
    As much as I tried none of the methods is working for me. Strange as it seems quite straight forward.

    But on the other hand while searching for a solution I found one quite interesting tool for working with VPN's which really made me happy.

    Its called VPN firewall and basicaly what it does is to only allow internet trafic when VPN is active. If it crashes than it will block all trafic. Thats quite good to protect yourself from your IP being revealed before you connect to VPN of when its down.
    Link here:

    https://github.com/adrelanos/VPN-Firewall

    PS: If anyone got VPN working after the start I'm keen for any more suggestions.
    Thanks

  7. #7
    Join Date
    2014-Jun
    Posts
    1
    I recently had the same issue as you bluudz, so if you still haven't found a solution or if anyone else is having trouble establishing an openvpn connection automatically after logging in here's what worked for me running 3.14-kali1-amd64 #1 SMP Debian 3.14.4-1kali1 (2014-05-14) x86_64 GNU/Linux:

    First off, assuming that you've made the changes to /etc/network/interfaces and /etc/NetworkManager/NetworkManager.conf as elfer mentioned, add your VPN via the gnome network manager interface if you haven't yet, making sure that the option "available to all users" in the bottom left has a checkmark.

    After you've configured it check to see if it will connect manually by clicking on the network icon in the top right and selecting your VPN from VPN Connections.

    Take note of the exact name of the VPN connection and the name of the wired or wireless connection you'll be using it with, just as they appear in the menu.

    Next edit your VPN connection configuration file to make NetworkManager store the VPN secrets by itself rather than inside a keyring that will be inaccessible by root: open up /etc/NetworkManager/system-connections/"name of your VPN connection" and change "password-flags" and "secret-flags" from 1 to 0.

    Alternatively you can add the following two lines to the same file:

    Code:
    [vpn-secrets]
     password=your_password
    If you happen to choose the first method you will have to edit your VPN connection via the network manager interface and add your password again so that it is stored properly.

    Next there needs to be a shell script in /etc/NetworkManager/dispatcher.d/ in order for the VPN connection process to start automatically.

    If you use the following it will connect to the VPN that you specify with the connection that you specify on restart and will reconnect to the VPN upon disconnection.

    Code:
    #! /bin/bash
    
    CONNECTION_NAME="<name-of-connection>"
    VPN_NAME="<name-of-vpn>"
    
    activ_con=$(nmcli con status | grep "${CONNECTION_NAME}")
    activ_vpn=$(nmcli con status | grep "${VPN_NAME}")
    if [ "${activ_con}" -a ! "${activ_vpn}" ];
    then
        nmcli con up id "${VPN_NAME}"
    fi
    Make sure you chmod +x it to be executable and make sure that root has ownership and is the only account with write access. For security reasons of course.

    And that's everything.
    Last edited by At0m5k; 2014-06-08 at 08:11.

  8. #8
    Join Date
    2014-Sep
    Posts
    1
    Thank you elfer, finally the VPN work for me.

  9. #9
    Join Date
    2014-Feb
    Posts
    4
    Thanks Elfer, it works for me for my problem on VMware Kali x64.

    Did this modifications and restart network-manager -> OK

    GG

Similar Threads

  1. Installation - Unpacking network-manager-openvpn-gnome
    By imnassii in forum Installing Archive
    Replies: 1
    Last Post: 2023-04-04, 23:11
  2. Network Manager Won't Start
    By Blam0 in forum TroubleShooting Archive
    Replies: 3
    Last Post: 2022-12-06, 11:37
  3. No internet connection and no Network Manager
    By MiguelEX3 in forum TroubleShooting Archive
    Replies: 0
    Last Post: 2020-03-28, 23:34
  4. OpenVPN plugin for network manager won't install
    By RagePoncho in forum General Archive
    Replies: 2
    Last Post: 2015-12-02, 22:36

Posting Permissions

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