How do you tell OpenVPN to run on startup?

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
1
down vote

favorite












I've done these exact same steps on two Ubuntu computers and it works just fine. I copied the exact same foo.conf file (along with a corresponding auth.txt file) into /etc/openvpn/ and it works if I manually enter service openvpn start. But I can't get it to work on startup. I don't remember having a problem before. It just worked.



/var/log/openvpn is empty. /etc/default/openvpn matches the working computer (AUTOSTART="all" is commented so it should use all by default).



It's not starting the VPN after a reboot though.










share|improve this question









New contributor




user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.























    up vote
    1
    down vote

    favorite












    I've done these exact same steps on two Ubuntu computers and it works just fine. I copied the exact same foo.conf file (along with a corresponding auth.txt file) into /etc/openvpn/ and it works if I manually enter service openvpn start. But I can't get it to work on startup. I don't remember having a problem before. It just worked.



    /var/log/openvpn is empty. /etc/default/openvpn matches the working computer (AUTOSTART="all" is commented so it should use all by default).



    It's not starting the VPN after a reboot though.










    share|improve this question









    New contributor




    user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
    Check out our Code of Conduct.





















      up vote
      1
      down vote

      favorite









      up vote
      1
      down vote

      favorite











      I've done these exact same steps on two Ubuntu computers and it works just fine. I copied the exact same foo.conf file (along with a corresponding auth.txt file) into /etc/openvpn/ and it works if I manually enter service openvpn start. But I can't get it to work on startup. I don't remember having a problem before. It just worked.



      /var/log/openvpn is empty. /etc/default/openvpn matches the working computer (AUTOSTART="all" is commented so it should use all by default).



      It's not starting the VPN after a reboot though.










      share|improve this question









      New contributor




      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      I've done these exact same steps on two Ubuntu computers and it works just fine. I copied the exact same foo.conf file (along with a corresponding auth.txt file) into /etc/openvpn/ and it works if I manually enter service openvpn start. But I can't get it to work on startup. I don't remember having a problem before. It just worked.



      /var/log/openvpn is empty. /etc/default/openvpn matches the working computer (AUTOSTART="all" is commented so it should use all by default).



      It's not starting the VPN after a reboot though.







      debian systemd openvpn






      share|improve this question









      New contributor




      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.











      share|improve this question









      New contributor




      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      share|improve this question




      share|improve this question








      edited 27 mins ago









      Filipe Brandenburger

      5,2441624




      5,2441624






      New contributor




      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.









      asked 3 hours ago









      user875234

      1062




      1062




      New contributor




      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.





      New contributor





      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.






      user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
      Check out our Code of Conduct.




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          0
          down vote













          Found an answer.



          Replace <server> with the name of your configuration file.



          sudo systemctl enable <server>.service
          sudo systemctl start <server>.service


          So for /etc/openvpn/foo.conf it would be



          sudo systemctl enable foo.service
          sudo systemctl start foo.service





          share|improve this answer








          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















          • This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
            – Filipe Brandenburger
            27 mins ago










          Your Answer








          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          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',
          convertImagesToLinks: false,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          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
          );



          );






          user875234 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481039%2fhow-do-you-tell-openvpn-to-run-on-startup%23new-answer', 'question_page');

          );

          Post as a guest






























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes








          up vote
          0
          down vote













          Found an answer.



          Replace <server> with the name of your configuration file.



          sudo systemctl enable <server>.service
          sudo systemctl start <server>.service


          So for /etc/openvpn/foo.conf it would be



          sudo systemctl enable foo.service
          sudo systemctl start foo.service





          share|improve this answer








          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















          • This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
            – Filipe Brandenburger
            27 mins ago














          up vote
          0
          down vote













          Found an answer.



          Replace <server> with the name of your configuration file.



          sudo systemctl enable <server>.service
          sudo systemctl start <server>.service


          So for /etc/openvpn/foo.conf it would be



          sudo systemctl enable foo.service
          sudo systemctl start foo.service





          share|improve this answer








          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.

















          • This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
            – Filipe Brandenburger
            27 mins ago












          up vote
          0
          down vote










          up vote
          0
          down vote









          Found an answer.



          Replace <server> with the name of your configuration file.



          sudo systemctl enable <server>.service
          sudo systemctl start <server>.service


          So for /etc/openvpn/foo.conf it would be



          sudo systemctl enable foo.service
          sudo systemctl start foo.service





          share|improve this answer








          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          Found an answer.



          Replace <server> with the name of your configuration file.



          sudo systemctl enable <server>.service
          sudo systemctl start <server>.service


          So for /etc/openvpn/foo.conf it would be



          sudo systemctl enable foo.service
          sudo systemctl start foo.service






          share|improve this answer








          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          share|improve this answer



          share|improve this answer






          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.









          answered 2 hours ago









          user875234

          1062




          1062




          New contributor




          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.





          New contributor





          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.






          user875234 is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
          Check out our Code of Conduct.











          • This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
            – Filipe Brandenburger
            27 mins ago
















          • This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
            – Filipe Brandenburger
            27 mins ago















          This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
          – Filipe Brandenburger
          27 mins ago




          This looks wrong to me... It will only work if there is a foo.service, created by you (which is what the answer at askfedora suggests) or by a generator of some kind... Do you already have a openvpn.service or perhaps openvpn@.service on your system? Please post which distribution version you're using (Debian Stretch?) and confirm which version of OpenVPN package you have around... If you can find the systemd services for OpenVPN their contents are also helpful here.
          – Filipe Brandenburger
          27 mins ago










          user875234 is a new contributor. Be nice, and check out our Code of Conduct.









           

          draft saved


          draft discarded


















          user875234 is a new contributor. Be nice, and check out our Code of Conduct.












          user875234 is a new contributor. Be nice, and check out our Code of Conduct.











          user875234 is a new contributor. Be nice, and check out our Code of Conduct.













           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481039%2fhow-do-you-tell-openvpn-to-run-on-startup%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?