connect OpenVPN client at Ubuntu startupConnect to OpenVPN on Ubuntu Server from Windows 7Can OpenVPN run and connect on startup?Generate an OpenVPN profile for client user to importOpenVPN connect on startupGetting “Cannot ioctl TUNSETIFF tun: Operation not permitted” when trying to connect to OpenVPNOpenVPN server and client configuration for openwrtConnecting to a OpenVPN Connect server breaks IPv6OpenVPN WARNING: Failed running command (--client-connect): could not execute external programOpenVPN client connection gets stuck at “Pre-connection initialization successful” after reboot in Linux Ubuntu 18Openvpn execute script on client-connect with restricted user

Can we say “you can pay when the order gets ready”?

How to write a column outside the braces in a matrix?

Check if a string is entirely made of the same substring

"You've called the wrong number" or "You called the wrong number"

Was there a shared-world project before "Thieves World"?

How much cash can I safely carry into the USA and avoid civil forfeiture?

How come there are so many candidates for the 2020 Democratic party presidential nomination?

How do I deal with a coworker that keeps asking to make small superficial changes to a report, and it is seriously triggering my anxiety?

Multiple options vs single option UI

Why must Chinese maps be obfuscated?

Do I have an "anti-research" personality?

Don’t seats that recline flat defeat the purpose of having seatbelts?

Function pointer with named arguments?

Was there a Viking Exchange as well as a Columbian one?

How does Captain America channel this power?

Phrase for the opposite of "foolproof"

Was Dennis Ritchie being too modest in this quote about C and Pascal?

Mistake in years of experience in resume?

Pre-plastic human skin alternative

Dynamic SOQL query relationship with field visibility for Users

Minor Revision with suggestion of an alternative proof by reviewer

Apply MapThread to all but one variable

A ​Note ​on ​N!

Philosophical question on logistic regression: why isn't the optimal threshold value trained?



connect OpenVPN client at Ubuntu startup


Connect to OpenVPN on Ubuntu Server from Windows 7Can OpenVPN run and connect on startup?Generate an OpenVPN profile for client user to importOpenVPN connect on startupGetting “Cannot ioctl TUNSETIFF tun: Operation not permitted” when trying to connect to OpenVPNOpenVPN server and client configuration for openwrtConnecting to a OpenVPN Connect server breaks IPv6OpenVPN WARNING: Failed running command (--client-connect): could not execute external programOpenVPN client connection gets stuck at “Pre-connection initialization successful” after reboot in Linux Ubuntu 18Openvpn execute script on client-connect with restricted user






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0















I would like to connect OpenVPN on Startup.



I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.



What is the proper procedure?










share|improve this question






















  • Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

    – Ondřej Xicht Světlík
    Aug 9 '18 at 20:45

















0















I would like to connect OpenVPN on Startup.



I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.



What is the proper procedure?










share|improve this question






















  • Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

    – Ondřej Xicht Světlík
    Aug 9 '18 at 20:45













0












0








0








I would like to connect OpenVPN on Startup.



I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.



What is the proper procedure?










share|improve this question














I would like to connect OpenVPN on Startup.



I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.



What is the proper procedure?







linux ubuntu vpn openvpn linux-networking






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Aug 9 '18 at 7:44









IanArmanIanArman

1316




1316












  • Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

    – Ondřej Xicht Světlík
    Aug 9 '18 at 20:45

















  • Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

    – Ondřej Xicht Světlík
    Aug 9 '18 at 20:45
















Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

– Ondřej Xicht Světlík
Aug 9 '18 at 20:45





Do you have any reason for not using openvpn as a service? This is the usual way to run something on startup. What version of Ubuntu are you using? I am asking to be able to tell you how to run the service properly as it depends on whether your Ubuntu uses System V init, systemd or something else.

– Ondřej Xicht Světlík
Aug 9 '18 at 20:45










3 Answers
3






active

oldest

votes


















0














I would add a .sh under /etc/init.d as described on this Unix & Linux stackexchange page or configure the service controller.



or use @reboot in crontab.



you should add what you've written in crontab to make us understand what's wrong, by the way.






share|improve this answer






























    0














    Using @reboot in crontab doesn't work, for this specific application.



    I created a /etc/rc.local, chmod u+x /etc/rc.local.



    Here we have the contents of the /etc/rc.local file



    openvpn ~/file.ovpn



    after rebooting the server, it successfully connected.






    share|improve this answer






























      0















      I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.




      As an admin you typically use cron to schedule recurring jobs, not to run daemons and services that need to start boot.



      Additionally, when you have admin rights, you don't use sudo in cron jobs, you set the correct user in the <user> field of the /etc/crontab or the /etc/cron.d/job.spec configuration file.




      What is the proper procedure?




      Read the manual: https://openvpn.net/index.php/open-source/documentation/howto.html#startup




      Linux

      If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.




      So it may already be sufficient to simply copy your config file to /etc/openvpn/connection-name.conf




      I recently had to set up OpenVPN on an Ubuntu 16.04 LTS server and the process was slightly more complicated, since with systemd the init script isn't used any more but instead a templated systemd unit file is used.



      1. Still copy your config file to /etc/openvpn/connection-name.conf

      2. Test if the "connection-name" OpenVPN connection will start with
        systemctl start openvpn@connection-name

      3. Confirm if the link gets established with:
        ip addr list and ip route list
        systemctl status openvpn@connection-name and/or
        journalctl --identifier ovpn-connection-name and/or

      4. Ensure that the service will persist across reboots:
        systemctl enable openvpn@connection-name





      share|improve this answer

























        Your Answer








        StackExchange.ready(function()
        var channelOptions =
        tags: "".split(" "),
        id: "2"
        ;
        initTagRenderer("".split(" "), "".split(" "), channelOptions);

        StackExchange.using("externalEditor", function()
        // Have to fire editor after snippets, if snippets enabled
        if (StackExchange.settings.snippets.snippetsEnabled)
        StackExchange.using("snippets", function()
        createEditor();
        );

        else
        createEditor();

        );

        function createEditor()
        StackExchange.prepareEditor(
        heartbeatType: 'answer',
        autoActivateHeartbeat: false,
        convertImagesToLinks: true,
        noModals: true,
        showLowRepImageUploadWarning: true,
        reputationToPostImages: 10,
        bindNavPrevention: true,
        postfix: "",
        imageUploader:
        brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
        contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
        allowUrls: true
        ,
        onDemand: true,
        discardSelector: ".discard-answer"
        ,immediatelyShowMarkdownHelp:true
        );



        );













        draft saved

        draft discarded


















        StackExchange.ready(
        function ()
        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f925587%2fconnect-openvpn-client-at-ubuntu-startup%23new-answer', 'question_page');

        );

        Post as a guest















        Required, but never shown

























        3 Answers
        3






        active

        oldest

        votes








        3 Answers
        3






        active

        oldest

        votes









        active

        oldest

        votes






        active

        oldest

        votes









        0














        I would add a .sh under /etc/init.d as described on this Unix & Linux stackexchange page or configure the service controller.



        or use @reboot in crontab.



        you should add what you've written in crontab to make us understand what's wrong, by the way.






        share|improve this answer



























          0














          I would add a .sh under /etc/init.d as described on this Unix & Linux stackexchange page or configure the service controller.



          or use @reboot in crontab.



          you should add what you've written in crontab to make us understand what's wrong, by the way.






          share|improve this answer

























            0












            0








            0







            I would add a .sh under /etc/init.d as described on this Unix & Linux stackexchange page or configure the service controller.



            or use @reboot in crontab.



            you should add what you've written in crontab to make us understand what's wrong, by the way.






            share|improve this answer













            I would add a .sh under /etc/init.d as described on this Unix & Linux stackexchange page or configure the service controller.



            or use @reboot in crontab.



            you should add what you've written in crontab to make us understand what's wrong, by the way.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Aug 9 '18 at 8:02









            altinturkaltinturk

            162




            162























                0














                Using @reboot in crontab doesn't work, for this specific application.



                I created a /etc/rc.local, chmod u+x /etc/rc.local.



                Here we have the contents of the /etc/rc.local file



                openvpn ~/file.ovpn



                after rebooting the server, it successfully connected.






                share|improve this answer



























                  0














                  Using @reboot in crontab doesn't work, for this specific application.



                  I created a /etc/rc.local, chmod u+x /etc/rc.local.



                  Here we have the contents of the /etc/rc.local file



                  openvpn ~/file.ovpn



                  after rebooting the server, it successfully connected.






                  share|improve this answer

























                    0












                    0








                    0







                    Using @reboot in crontab doesn't work, for this specific application.



                    I created a /etc/rc.local, chmod u+x /etc/rc.local.



                    Here we have the contents of the /etc/rc.local file



                    openvpn ~/file.ovpn



                    after rebooting the server, it successfully connected.






                    share|improve this answer













                    Using @reboot in crontab doesn't work, for this specific application.



                    I created a /etc/rc.local, chmod u+x /etc/rc.local.



                    Here we have the contents of the /etc/rc.local file



                    openvpn ~/file.ovpn



                    after rebooting the server, it successfully connected.







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Aug 9 '18 at 8:24









                    IanArmanIanArman

                    1316




                    1316





















                        0















                        I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.




                        As an admin you typically use cron to schedule recurring jobs, not to run daemons and services that need to start boot.



                        Additionally, when you have admin rights, you don't use sudo in cron jobs, you set the correct user in the <user> field of the /etc/crontab or the /etc/cron.d/job.spec configuration file.




                        What is the proper procedure?




                        Read the manual: https://openvpn.net/index.php/open-source/documentation/howto.html#startup




                        Linux

                        If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.




                        So it may already be sufficient to simply copy your config file to /etc/openvpn/connection-name.conf




                        I recently had to set up OpenVPN on an Ubuntu 16.04 LTS server and the process was slightly more complicated, since with systemd the init script isn't used any more but instead a templated systemd unit file is used.



                        1. Still copy your config file to /etc/openvpn/connection-name.conf

                        2. Test if the "connection-name" OpenVPN connection will start with
                          systemctl start openvpn@connection-name

                        3. Confirm if the link gets established with:
                          ip addr list and ip route list
                          systemctl status openvpn@connection-name and/or
                          journalctl --identifier ovpn-connection-name and/or

                        4. Ensure that the service will persist across reboots:
                          systemctl enable openvpn@connection-name





                        share|improve this answer





























                          0















                          I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.




                          As an admin you typically use cron to schedule recurring jobs, not to run daemons and services that need to start boot.



                          Additionally, when you have admin rights, you don't use sudo in cron jobs, you set the correct user in the <user> field of the /etc/crontab or the /etc/cron.d/job.spec configuration file.




                          What is the proper procedure?




                          Read the manual: https://openvpn.net/index.php/open-source/documentation/howto.html#startup




                          Linux

                          If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.




                          So it may already be sufficient to simply copy your config file to /etc/openvpn/connection-name.conf




                          I recently had to set up OpenVPN on an Ubuntu 16.04 LTS server and the process was slightly more complicated, since with systemd the init script isn't used any more but instead a templated systemd unit file is used.



                          1. Still copy your config file to /etc/openvpn/connection-name.conf

                          2. Test if the "connection-name" OpenVPN connection will start with
                            systemctl start openvpn@connection-name

                          3. Confirm if the link gets established with:
                            ip addr list and ip route list
                            systemctl status openvpn@connection-name and/or
                            journalctl --identifier ovpn-connection-name and/or

                          4. Ensure that the service will persist across reboots:
                            systemctl enable openvpn@connection-name





                          share|improve this answer



























                            0












                            0








                            0








                            I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.




                            As an admin you typically use cron to schedule recurring jobs, not to run daemons and services that need to start boot.



                            Additionally, when you have admin rights, you don't use sudo in cron jobs, you set the correct user in the <user> field of the /etc/crontab or the /etc/cron.d/job.spec configuration file.




                            What is the proper procedure?




                            Read the manual: https://openvpn.net/index.php/open-source/documentation/howto.html#startup




                            Linux

                            If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.




                            So it may already be sufficient to simply copy your config file to /etc/openvpn/connection-name.conf




                            I recently had to set up OpenVPN on an Ubuntu 16.04 LTS server and the process was slightly more complicated, since with systemd the init script isn't used any more but instead a templated systemd unit file is used.



                            1. Still copy your config file to /etc/openvpn/connection-name.conf

                            2. Test if the "connection-name" OpenVPN connection will start with
                              systemctl start openvpn@connection-name

                            3. Confirm if the link gets established with:
                              ip addr list and ip route list
                              systemctl status openvpn@connection-name and/or
                              journalctl --identifier ovpn-connection-name and/or

                            4. Ensure that the service will persist across reboots:
                              systemctl enable openvpn@connection-name





                            share|improve this answer
















                            I've added sudo openvpn /file.ovpn to the crontab, and it doesn't connect at startup.




                            As an admin you typically use cron to schedule recurring jobs, not to run daemons and services that need to start boot.



                            Additionally, when you have admin rights, you don't use sudo in cron jobs, you set the correct user in the <user> field of the /etc/crontab or the /etc/cron.d/job.spec configuration file.




                            What is the proper procedure?




                            Read the manual: https://openvpn.net/index.php/open-source/documentation/howto.html#startup




                            Linux

                            If you install OpenVPN via an RPM or DEB package on Linux, the installer will set up an initscript. When executed, the initscript will scan for .conf configuration files in /etc/openvpn, and if found, will start up a separate OpenVPN daemon for each file.




                            So it may already be sufficient to simply copy your config file to /etc/openvpn/connection-name.conf




                            I recently had to set up OpenVPN on an Ubuntu 16.04 LTS server and the process was slightly more complicated, since with systemd the init script isn't used any more but instead a templated systemd unit file is used.



                            1. Still copy your config file to /etc/openvpn/connection-name.conf

                            2. Test if the "connection-name" OpenVPN connection will start with
                              systemctl start openvpn@connection-name

                            3. Confirm if the link gets established with:
                              ip addr list and ip route list
                              systemctl status openvpn@connection-name and/or
                              journalctl --identifier ovpn-connection-name and/or

                            4. Ensure that the service will persist across reboots:
                              systemctl enable openvpn@connection-name






                            share|improve this answer














                            share|improve this answer



                            share|improve this answer








                            edited Aug 23 '18 at 12:31

























                            answered Aug 9 '18 at 8:15









                            HBruijnHBruijn

                            57.2k1190150




                            57.2k1190150



























                                draft saved

                                draft discarded
















































                                Thanks for contributing an answer to Server Fault!


                                • Please be sure to answer the question. Provide details and share your research!

                                But avoid


                                • Asking for help, clarification, or responding to other answers.

                                • Making statements based on opinion; back them up with references or personal experience.

                                To learn more, see our tips on writing great answers.




                                draft saved


                                draft discarded














                                StackExchange.ready(
                                function ()
                                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f925587%2fconnect-openvpn-client-at-ubuntu-startup%23new-answer', 'question_page');

                                );

                                Post as a guest















                                Required, but never shown





















































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown

































                                Required, but never shown














                                Required, but never shown












                                Required, but never shown







                                Required, but never shown







                                Popular posts from this blog

                                Wikipedia:Vital articles Мазмуну Biography - Өмүр баян Philosophy and psychology - Философия жана психология Religion - Дин Social sciences - Коомдук илимдер Language and literature - Тил жана адабият Science - Илим Technology - Технология Arts and recreation - Искусство жана эс алуу History and geography - Тарых жана география Навигация менюсу

                                Bruxelas-Capital Índice Historia | Composición | Situación lingüística | Clima | Cidades irmandadas | Notas | Véxase tamén | Menú de navegacióneO uso das linguas en Bruxelas e a situación do neerlandés"Rexión de Bruxelas Capital"o orixinalSitio da rexiónPáxina de Bruselas no sitio da Oficina de Promoción Turística de Valonia e BruxelasMapa Interactivo da Rexión de Bruxelas-CapitaleeWorldCat332144929079854441105155190212ID28008674080552-90000 0001 0666 3698n94104302ID540940339365017018237

                                What should I write in an apology letter, since I have decided not to join a company after accepting an offer letterShould I keep looking after accepting a job offer?What should I do when I've been verbally told I would get an offer letter, but still haven't gotten one after 4 weeks?Do I accept an offer from a company that I am not likely to join?New job hasn't confirmed starting date and I want to give current employer as much notice as possibleHow should I address my manager in my resignation letter?HR delayed background verification, now jobless as resignedNo email communication after accepting a formal written offer. How should I phrase the call?What should I do if after receiving a verbal offer letter I am informed that my written job offer is put on hold due to some internal issues?Should I inform the current employer that I am about to resign within 1-2 weeks since I have signed the offer letter and waiting for visa?What company will do, if I send their offer letter to another company