Auto start Openvpn with one .ovpn file The Next CEO of Stack OverflowTorgaurd will not start...

What is ( CFMCC ) on ILS approach chart?

Why did we only see the N-1 starfighters in one film?

Is it my responsibility to learn a new technology in my own time my employer wants to implement?

Is it possible to search for a directory/file combination?

Are there any limitations on attacking while grappling?

Are there any unintended negative consequences to allowing PCs to gain multiple levels at once in a short milestone-XP game?

Written every which way

How should I support this large drywall patch?

Would this house-rule that treats advantage as a +1 to the roll instead (and disadvantage as -1) and allows them to stack be balanced?

How to start emacs in "nothing" mode (`fundamental-mode`)

Contours of a clandestine nature

Can we say or write : "No, it'sn't"?

Is it professional to write unrelated content in an almost-empty email?

How did people program for Consoles with multiple CPUs?

Inappropriate reference requests from Journal reviewers

If the heap is initialized for security, then why is the stack uninitialized?

How to transpose the 1st and -1th levels of arbitrarily nested array?

Anatomically Correct Strange Women In Ponds Distributing Swords

At which OSI layer a user-generated data resides?

Is HostGator storing my password in plaintext?

How to make a variable always equal to the result of some calculations?

Is there an analogue of projective spaces for proper schemes?

Non-deterministic sum of floats

Skipping indices in a product



Auto start Openvpn with one .ovpn file



The Next CEO of Stack OverflowTorgaurd will not start with Crontab at rebootHow can I automatically connect to wifi + openvpn on startup/resume when “Automatically connect to wifi” is enabled?OpenVPN Logs “IP Packet with unknown IP version=15”Ubuntu openvpn daemonRedirect one IP to VPN (openvpn)Difference between OpenVPN Access Server and just OpenVPNstart openvpn client automatically at certain time?OpenVPN TLS HandShake Failed with Linux Server/Windows ClientOpenVPN two configs routing traffic for only onePrevent OpenVPN from disconnecting (with PIA) via CLI?Failure to start ufw after OpenVPN connectionxubuntu openvpn connected bu ip adress not change












7















Hi i bought vpn access form a vpn provider, i got a bunch of .ovpn files.



How can i get openvpn to startup one of these .opvn files under start/boot up?



I would like to, not have to run openvpn --config VPNservername.ovpn every time i have to do a reboot.
I'm running ubuntu 12.04 server.



I have installed openvpn










share|improve this question





























    7















    Hi i bought vpn access form a vpn provider, i got a bunch of .ovpn files.



    How can i get openvpn to startup one of these .opvn files under start/boot up?



    I would like to, not have to run openvpn --config VPNservername.ovpn every time i have to do a reboot.
    I'm running ubuntu 12.04 server.



    I have installed openvpn










    share|improve this question



























      7












      7








      7


      2






      Hi i bought vpn access form a vpn provider, i got a bunch of .ovpn files.



      How can i get openvpn to startup one of these .opvn files under start/boot up?



      I would like to, not have to run openvpn --config VPNservername.ovpn every time i have to do a reboot.
      I'm running ubuntu 12.04 server.



      I have installed openvpn










      share|improve this question
















      Hi i bought vpn access form a vpn provider, i got a bunch of .ovpn files.



      How can i get openvpn to startup one of these .opvn files under start/boot up?



      I would like to, not have to run openvpn --config VPNservername.ovpn every time i have to do a reboot.
      I'm running ubuntu 12.04 server.



      I have installed openvpn







      openvpn






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 16 mins ago







      starR

















      asked Feb 25 '14 at 19:33









      starRstarR

      1202311




      1202311






















          4 Answers
          4






          active

          oldest

          votes


















          13














          When you have installed openvpn from the repo, everything is already prepared for you.



          Place the whatever.conf file in /etc/openvpn/ and a daemon will be started for it at boot.



          Edit



          Please note that *.opvn will not work, *.conf will.






          share|improve this answer


























          • @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

            – Klaus-Dieter Warzecha
            Feb 25 '14 at 22:56











          • My pleasure :-)

            – Klaus-Dieter Warzecha
            Feb 26 '14 at 0:04



















          2














          Note, that /etc/default/openvpn file contain AUTOSTART option. You can add there all your configs without .conf at the end you want to autostart. But don't forget to do:



          systemctl daemon-reload


          after editing it.






          share|improve this answer



















          • 1





            This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

            – fosslinux
            Jul 22 '16 at 5:09








          • 5





            Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

            – AstraSerg
            Jul 24 '16 at 6:39











          • @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

            – Sirens
            May 30 '17 at 5:17











          • This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

            – TheCatWhisperer
            Oct 28 '18 at 20:14



















          0














          If on ubuntu server: go to rc.local.
          vi /etc/rc.local
          add the following line
          openvpn --config /your/path/file.ovpn
          save and reboot.






          share|improve this answer
























          • wouldn't that block the rest of the /etc/rc.local script from running?

            – ozma
            Jul 2 '17 at 11:52



















          0














          Put the keys, certificates, and client configuration file in the proper folders...



          /etc/openvpn/ca.crt
          /etc/openvpn/client/client0.crt
          /etc/openvpn/client/client0.key
          /etc/openvpn/client/ta.key
          /etc/openvpn/client/client0.conf


          Enable OpenVPN client service to start at boot and start it...



          systemctl enable openvpn-client@client0
          systemctl start openvpn-client@client0


          NOTE: In the example "client0" is the name of the configuration chosen!



          TIP: Client configuration example...



          client
          remote <OPENVPN_SERVER_IP_OR_NAME> 1194
          dev tun
          proto udp
          resolv-retry infinite
          nobind
          persist-key
          persist-tun
          verb 3
          cipher AES-256-CBC
          keepalive 10 120
          compress lz4-v2
          auth-nocache
          remote-cert-tls server

          ca /etc/openvpn/ca.crt
          cert /etc/openvpn/client/client0.crt
          key /etc/openvpn/client/client0.key
          tls-auth /etc/openvpn/client/ta.key 1


          Thanks! =D






          share|improve this answer
























            Your Answer








            StackExchange.ready(function() {
            var channelOptions = {
            tags: "".split(" "),
            id: "89"
            };
            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%2faskubuntu.com%2fquestions%2f426211%2fauto-start-openvpn-with-one-ovpn-file%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown

























            4 Answers
            4






            active

            oldest

            votes








            4 Answers
            4






            active

            oldest

            votes









            active

            oldest

            votes






            active

            oldest

            votes









            13














            When you have installed openvpn from the repo, everything is already prepared for you.



            Place the whatever.conf file in /etc/openvpn/ and a daemon will be started for it at boot.



            Edit



            Please note that *.opvn will not work, *.conf will.






            share|improve this answer


























            • @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

              – Klaus-Dieter Warzecha
              Feb 25 '14 at 22:56











            • My pleasure :-)

              – Klaus-Dieter Warzecha
              Feb 26 '14 at 0:04
















            13














            When you have installed openvpn from the repo, everything is already prepared for you.



            Place the whatever.conf file in /etc/openvpn/ and a daemon will be started for it at boot.



            Edit



            Please note that *.opvn will not work, *.conf will.






            share|improve this answer


























            • @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

              – Klaus-Dieter Warzecha
              Feb 25 '14 at 22:56











            • My pleasure :-)

              – Klaus-Dieter Warzecha
              Feb 26 '14 at 0:04














            13












            13








            13







            When you have installed openvpn from the repo, everything is already prepared for you.



            Place the whatever.conf file in /etc/openvpn/ and a daemon will be started for it at boot.



            Edit



            Please note that *.opvn will not work, *.conf will.






            share|improve this answer















            When you have installed openvpn from the repo, everything is already prepared for you.



            Place the whatever.conf file in /etc/openvpn/ and a daemon will be started for it at boot.



            Edit



            Please note that *.opvn will not work, *.conf will.







            share|improve this answer














            share|improve this answer



            share|improve this answer








            edited Feb 25 '14 at 23:00

























            answered Feb 25 '14 at 19:43









            Klaus-Dieter WarzechaKlaus-Dieter Warzecha

            2,11211420




            2,11211420













            • @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

              – Klaus-Dieter Warzecha
              Feb 25 '14 at 22:56











            • My pleasure :-)

              – Klaus-Dieter Warzecha
              Feb 26 '14 at 0:04



















            • @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

              – Klaus-Dieter Warzecha
              Feb 25 '14 at 22:56











            • My pleasure :-)

              – Klaus-Dieter Warzecha
              Feb 26 '14 at 0:04

















            @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

            – Klaus-Dieter Warzecha
            Feb 25 '14 at 22:56





            @staR I don't know if that was really necessary. But anyway, please try to copy whatever.ovpn to /etc/openvpn/. You'll have to have root rights for this and rename it to whatever.conf. Good luck!

            – Klaus-Dieter Warzecha
            Feb 25 '14 at 22:56













            My pleasure :-)

            – Klaus-Dieter Warzecha
            Feb 26 '14 at 0:04





            My pleasure :-)

            – Klaus-Dieter Warzecha
            Feb 26 '14 at 0:04













            2














            Note, that /etc/default/openvpn file contain AUTOSTART option. You can add there all your configs without .conf at the end you want to autostart. But don't forget to do:



            systemctl daemon-reload


            after editing it.






            share|improve this answer



















            • 1





              This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

              – fosslinux
              Jul 22 '16 at 5:09








            • 5





              Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

              – AstraSerg
              Jul 24 '16 at 6:39











            • @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

              – Sirens
              May 30 '17 at 5:17











            • This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

              – TheCatWhisperer
              Oct 28 '18 at 20:14
















            2














            Note, that /etc/default/openvpn file contain AUTOSTART option. You can add there all your configs without .conf at the end you want to autostart. But don't forget to do:



            systemctl daemon-reload


            after editing it.






            share|improve this answer



















            • 1





              This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

              – fosslinux
              Jul 22 '16 at 5:09








            • 5





              Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

              – AstraSerg
              Jul 24 '16 at 6:39











            • @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

              – Sirens
              May 30 '17 at 5:17











            • This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

              – TheCatWhisperer
              Oct 28 '18 at 20:14














            2












            2








            2







            Note, that /etc/default/openvpn file contain AUTOSTART option. You can add there all your configs without .conf at the end you want to autostart. But don't forget to do:



            systemctl daemon-reload


            after editing it.






            share|improve this answer













            Note, that /etc/default/openvpn file contain AUTOSTART option. You can add there all your configs without .conf at the end you want to autostart. But don't forget to do:



            systemctl daemon-reload


            after editing it.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Jul 22 '16 at 4:47









            AstraSergAstraSerg

            1312




            1312








            • 1





              This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

              – fosslinux
              Jul 22 '16 at 5:09








            • 5





              Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

              – AstraSerg
              Jul 24 '16 at 6:39











            • @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

              – Sirens
              May 30 '17 at 5:17











            • This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

              – TheCatWhisperer
              Oct 28 '18 at 20:14














            • 1





              This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

              – fosslinux
              Jul 22 '16 at 5:09








            • 5





              Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

              – AstraSerg
              Jul 24 '16 at 6:39











            • @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

              – Sirens
              May 30 '17 at 5:17











            • This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

              – TheCatWhisperer
              Oct 28 '18 at 20:14








            1




            1





            This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

            – fosslinux
            Jul 22 '16 at 5:09







            This is irrelevant to this question as it was asked a long time ago and the OP is running Ubuntu 12.04. And it dosen't seem the OP is going to accept - he hasn't been on for 3 months.

            – fosslinux
            Jul 22 '16 at 5:09






            5




            5





            Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

            – AstraSerg
            Jul 24 '16 at 6:39





            Nevertheless, I believe it could help people, who's looking for the answers with similar problems.

            – AstraSerg
            Jul 24 '16 at 6:39













            @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

            – Sirens
            May 30 '17 at 5:17





            @ubashu I don't think this is irrelevant. Answers should change based on newer versions of software. This is the top result for me when I search.

            – Sirens
            May 30 '17 at 5:17













            This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

            – TheCatWhisperer
            Oct 28 '18 at 20:14





            This helped me a lot today and should be upvoted, thanks for the answer @AstraSerg

            – TheCatWhisperer
            Oct 28 '18 at 20:14











            0














            If on ubuntu server: go to rc.local.
            vi /etc/rc.local
            add the following line
            openvpn --config /your/path/file.ovpn
            save and reboot.






            share|improve this answer
























            • wouldn't that block the rest of the /etc/rc.local script from running?

              – ozma
              Jul 2 '17 at 11:52
















            0














            If on ubuntu server: go to rc.local.
            vi /etc/rc.local
            add the following line
            openvpn --config /your/path/file.ovpn
            save and reboot.






            share|improve this answer
























            • wouldn't that block the rest of the /etc/rc.local script from running?

              – ozma
              Jul 2 '17 at 11:52














            0












            0








            0







            If on ubuntu server: go to rc.local.
            vi /etc/rc.local
            add the following line
            openvpn --config /your/path/file.ovpn
            save and reboot.






            share|improve this answer













            If on ubuntu server: go to rc.local.
            vi /etc/rc.local
            add the following line
            openvpn --config /your/path/file.ovpn
            save and reboot.







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered May 27 '17 at 16:13









            Andres NunezAndres Nunez

            1




            1













            • wouldn't that block the rest of the /etc/rc.local script from running?

              – ozma
              Jul 2 '17 at 11:52



















            • wouldn't that block the rest of the /etc/rc.local script from running?

              – ozma
              Jul 2 '17 at 11:52

















            wouldn't that block the rest of the /etc/rc.local script from running?

            – ozma
            Jul 2 '17 at 11:52





            wouldn't that block the rest of the /etc/rc.local script from running?

            – ozma
            Jul 2 '17 at 11:52











            0














            Put the keys, certificates, and client configuration file in the proper folders...



            /etc/openvpn/ca.crt
            /etc/openvpn/client/client0.crt
            /etc/openvpn/client/client0.key
            /etc/openvpn/client/ta.key
            /etc/openvpn/client/client0.conf


            Enable OpenVPN client service to start at boot and start it...



            systemctl enable openvpn-client@client0
            systemctl start openvpn-client@client0


            NOTE: In the example "client0" is the name of the configuration chosen!



            TIP: Client configuration example...



            client
            remote <OPENVPN_SERVER_IP_OR_NAME> 1194
            dev tun
            proto udp
            resolv-retry infinite
            nobind
            persist-key
            persist-tun
            verb 3
            cipher AES-256-CBC
            keepalive 10 120
            compress lz4-v2
            auth-nocache
            remote-cert-tls server

            ca /etc/openvpn/ca.crt
            cert /etc/openvpn/client/client0.crt
            key /etc/openvpn/client/client0.key
            tls-auth /etc/openvpn/client/ta.key 1


            Thanks! =D






            share|improve this answer




























              0














              Put the keys, certificates, and client configuration file in the proper folders...



              /etc/openvpn/ca.crt
              /etc/openvpn/client/client0.crt
              /etc/openvpn/client/client0.key
              /etc/openvpn/client/ta.key
              /etc/openvpn/client/client0.conf


              Enable OpenVPN client service to start at boot and start it...



              systemctl enable openvpn-client@client0
              systemctl start openvpn-client@client0


              NOTE: In the example "client0" is the name of the configuration chosen!



              TIP: Client configuration example...



              client
              remote <OPENVPN_SERVER_IP_OR_NAME> 1194
              dev tun
              proto udp
              resolv-retry infinite
              nobind
              persist-key
              persist-tun
              verb 3
              cipher AES-256-CBC
              keepalive 10 120
              compress lz4-v2
              auth-nocache
              remote-cert-tls server

              ca /etc/openvpn/ca.crt
              cert /etc/openvpn/client/client0.crt
              key /etc/openvpn/client/client0.key
              tls-auth /etc/openvpn/client/ta.key 1


              Thanks! =D






              share|improve this answer


























                0












                0








                0







                Put the keys, certificates, and client configuration file in the proper folders...



                /etc/openvpn/ca.crt
                /etc/openvpn/client/client0.crt
                /etc/openvpn/client/client0.key
                /etc/openvpn/client/ta.key
                /etc/openvpn/client/client0.conf


                Enable OpenVPN client service to start at boot and start it...



                systemctl enable openvpn-client@client0
                systemctl start openvpn-client@client0


                NOTE: In the example "client0" is the name of the configuration chosen!



                TIP: Client configuration example...



                client
                remote <OPENVPN_SERVER_IP_OR_NAME> 1194
                dev tun
                proto udp
                resolv-retry infinite
                nobind
                persist-key
                persist-tun
                verb 3
                cipher AES-256-CBC
                keepalive 10 120
                compress lz4-v2
                auth-nocache
                remote-cert-tls server

                ca /etc/openvpn/ca.crt
                cert /etc/openvpn/client/client0.crt
                key /etc/openvpn/client/client0.key
                tls-auth /etc/openvpn/client/ta.key 1


                Thanks! =D






                share|improve this answer













                Put the keys, certificates, and client configuration file in the proper folders...



                /etc/openvpn/ca.crt
                /etc/openvpn/client/client0.crt
                /etc/openvpn/client/client0.key
                /etc/openvpn/client/ta.key
                /etc/openvpn/client/client0.conf


                Enable OpenVPN client service to start at boot and start it...



                systemctl enable openvpn-client@client0
                systemctl start openvpn-client@client0


                NOTE: In the example "client0" is the name of the configuration chosen!



                TIP: Client configuration example...



                client
                remote <OPENVPN_SERVER_IP_OR_NAME> 1194
                dev tun
                proto udp
                resolv-retry infinite
                nobind
                persist-key
                persist-tun
                verb 3
                cipher AES-256-CBC
                keepalive 10 120
                compress lz4-v2
                auth-nocache
                remote-cert-tls server

                ca /etc/openvpn/ca.crt
                cert /etc/openvpn/client/client0.crt
                key /etc/openvpn/client/client0.key
                tls-auth /etc/openvpn/client/ta.key 1


                Thanks! =D







                share|improve this answer












                share|improve this answer



                share|improve this answer










                answered Jul 5 '18 at 21:33









                Eduardo LucioEduardo Lucio

                1799




                1799






























                    draft saved

                    draft discarded




















































                    Thanks for contributing an answer to Ask Ubuntu!


                    • 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%2faskubuntu.com%2fquestions%2f426211%2fauto-start-openvpn-with-one-ovpn-file%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