Use the same common parameters for all openvpn config files

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











up vote
3
down vote

favorite












I have several openvpn .conf files for various vpns, and they all need to have these lines at the end of the file, like



script-security ...
setenv PATH ...
up ...
down ...
down-pre ...


Is there a way to set this configuration globally across all files or in openvpn somewhere? I don't want to modify any of the individual vpn files if it's possible to configure it someplace centrally or globally.



I'm starting the config files with systemd, so sudo systemctl start openvpn-client@vpn1.service.







share|improve this question


























    up vote
    3
    down vote

    favorite












    I have several openvpn .conf files for various vpns, and they all need to have these lines at the end of the file, like



    script-security ...
    setenv PATH ...
    up ...
    down ...
    down-pre ...


    Is there a way to set this configuration globally across all files or in openvpn somewhere? I don't want to modify any of the individual vpn files if it's possible to configure it someplace centrally or globally.



    I'm starting the config files with systemd, so sudo systemctl start openvpn-client@vpn1.service.







    share|improve this question
























      up vote
      3
      down vote

      favorite









      up vote
      3
      down vote

      favorite











      I have several openvpn .conf files for various vpns, and they all need to have these lines at the end of the file, like



      script-security ...
      setenv PATH ...
      up ...
      down ...
      down-pre ...


      Is there a way to set this configuration globally across all files or in openvpn somewhere? I don't want to modify any of the individual vpn files if it's possible to configure it someplace centrally or globally.



      I'm starting the config files with systemd, so sudo systemctl start openvpn-client@vpn1.service.







      share|improve this question














      I have several openvpn .conf files for various vpns, and they all need to have these lines at the end of the file, like



      script-security ...
      setenv PATH ...
      up ...
      down ...
      down-pre ...


      Is there a way to set this configuration globally across all files or in openvpn somewhere? I don't want to modify any of the individual vpn files if it's possible to configure it someplace centrally or globally.



      I'm starting the config files with systemd, so sudo systemctl start openvpn-client@vpn1.service.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Nov 10 '17 at 10:11

























      asked Nov 10 '17 at 9:49









      user779159

      21728




      21728




















          1 Answer
          1






          active

          oldest

          votes

















          up vote
          4
          down vote



          accepted










          You can use the --config command line option multiple times to merge configurations or also include the config option inside a config file to refer to others.



          Source:OpenVPN - Getting started How-To






          share|improve this answer






















          • I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
            – user779159
            Nov 10 '17 at 10:12










          • You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
            – Zip
            Nov 10 '17 at 10:38










          • Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
            – user779159
            Nov 10 '17 at 10:50










          • It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
            – Zip
            Nov 10 '17 at 10:56











          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: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403715%2fuse-the-same-common-parameters-for-all-openvpn-config-files%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
          4
          down vote



          accepted










          You can use the --config command line option multiple times to merge configurations or also include the config option inside a config file to refer to others.



          Source:OpenVPN - Getting started How-To






          share|improve this answer






















          • I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
            – user779159
            Nov 10 '17 at 10:12










          • You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
            – Zip
            Nov 10 '17 at 10:38










          • Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
            – user779159
            Nov 10 '17 at 10:50










          • It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
            – Zip
            Nov 10 '17 at 10:56















          up vote
          4
          down vote



          accepted










          You can use the --config command line option multiple times to merge configurations or also include the config option inside a config file to refer to others.



          Source:OpenVPN - Getting started How-To






          share|improve this answer






















          • I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
            – user779159
            Nov 10 '17 at 10:12










          • You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
            – Zip
            Nov 10 '17 at 10:38










          • Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
            – user779159
            Nov 10 '17 at 10:50










          • It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
            – Zip
            Nov 10 '17 at 10:56













          up vote
          4
          down vote



          accepted







          up vote
          4
          down vote



          accepted






          You can use the --config command line option multiple times to merge configurations or also include the config option inside a config file to refer to others.



          Source:OpenVPN - Getting started How-To






          share|improve this answer














          You can use the --config command line option multiple times to merge configurations or also include the config option inside a config file to refer to others.



          Source:OpenVPN - Getting started How-To







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Nov 10 '17 at 13:20









          GAD3R

          22.7k154895




          22.7k154895










          answered Nov 10 '17 at 10:03









          Zip

          51118




          51118











          • I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
            – user779159
            Nov 10 '17 at 10:12










          • You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
            – Zip
            Nov 10 '17 at 10:38










          • Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
            – user779159
            Nov 10 '17 at 10:50










          • It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
            – Zip
            Nov 10 '17 at 10:56

















          • I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
            – user779159
            Nov 10 '17 at 10:12










          • You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
            – Zip
            Nov 10 '17 at 10:38










          • Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
            – user779159
            Nov 10 '17 at 10:50










          • It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
            – Zip
            Nov 10 '17 at 10:56
















          I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
          – user779159
          Nov 10 '17 at 10:12




          I've updated my question to show that I'm starting the vpns with systemd, how could I pass the --config option to systemd? I don't want to include the config option inside the config file because there are a lot of config files, I'd rather do it centrally like in some openvpn or systemd central configuration.
          – user779159
          Nov 10 '17 at 10:12












          You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
          – Zip
          Nov 10 '17 at 10:38




          You can edit/copy the systemd unit file to include the option as it calls openvpn. Also a good practice would be to remove the duplicate lines from existing configs (avoiding conflicts), hence you can just add the config entry as you do it. Would it be enough? I can add it to the answer...
          – Zip
          Nov 10 '17 at 10:38












          Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
          – user779159
          Nov 10 '17 at 10:50




          Is /usr/lib/systemd/system/openvpn-client@.service the systemd unit file you're referring to? How exactly can I modify that file to add the 5 config params I need to from the question? Ideally I could create a single file with just those 5 lines it and refer to it in the unit file so that so I can add just one thing to that unit file instead of 5 things.
          – user779159
          Nov 10 '17 at 10:50












          It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
          – Zip
          Nov 10 '17 at 10:56





          It's pretty much that what I am suggesting. You can "override" the openvpn unit file, updating the ExecStart= line to include an extra --config path/to/conf, where you can have as many parameters as you'd like. If your unit doesn't have such line, please add it to the question so I can figure it out, but mine does. Tell me so I can update the answer accordingly...
          – Zip
          Nov 10 '17 at 10:56


















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f403715%2fuse-the-same-common-parameters-for-all-openvpn-config-files%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?

          Bahrain

          Postfix configuration issue with fips on centos 7; mailgun relay