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;
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
add a comment |
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
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
add a comment |
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
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
linux ubuntu vpn openvpn linux-networking
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
add a comment |
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
add a comment |
3 Answers
3
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
- Still copy your config file to
/etc/openvpn/connection-name.conf
- Test if the "connection-name" OpenVPN connection will start with
systemctl start openvpn@connection-name
- Confirm if the link gets established with:
ip addr list
andip route list
systemctl status openvpn@connection-name
and/orjournalctl --identifier ovpn-connection-name
and/or - Ensure that the service will persist across reboots:
systemctl enable openvpn@connection-name
add a comment |
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
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
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.
add a comment |
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.
add a comment |
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.
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.
answered Aug 9 '18 at 8:02
altinturkaltinturk
162
162
add a comment |
add a comment |
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.
add a comment |
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.
add a comment |
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.
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.
answered Aug 9 '18 at 8:24
IanArmanIanArman
1316
1316
add a comment |
add a comment |
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.
- Still copy your config file to
/etc/openvpn/connection-name.conf
- Test if the "connection-name" OpenVPN connection will start with
systemctl start openvpn@connection-name
- Confirm if the link gets established with:
ip addr list
andip route list
systemctl status openvpn@connection-name
and/orjournalctl --identifier ovpn-connection-name
and/or - Ensure that the service will persist across reboots:
systemctl enable openvpn@connection-name
add a comment |
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.
- Still copy your config file to
/etc/openvpn/connection-name.conf
- Test if the "connection-name" OpenVPN connection will start with
systemctl start openvpn@connection-name
- Confirm if the link gets established with:
ip addr list
andip route list
systemctl status openvpn@connection-name
and/orjournalctl --identifier ovpn-connection-name
and/or - Ensure that the service will persist across reboots:
systemctl enable openvpn@connection-name
add a comment |
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.
- Still copy your config file to
/etc/openvpn/connection-name.conf
- Test if the "connection-name" OpenVPN connection will start with
systemctl start openvpn@connection-name
- Confirm if the link gets established with:
ip addr list
andip route list
systemctl status openvpn@connection-name
and/orjournalctl --identifier ovpn-connection-name
and/or - Ensure that the service will persist across reboots:
systemctl enable openvpn@connection-name
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.
- Still copy your config file to
/etc/openvpn/connection-name.conf
- Test if the "connection-name" OpenVPN connection will start with
systemctl start openvpn@connection-name
- Confirm if the link gets established with:
ip addr list
andip route list
systemctl status openvpn@connection-name
and/orjournalctl --identifier ovpn-connection-name
and/or - Ensure that the service will persist across reboots:
systemctl enable openvpn@connection-name
edited Aug 23 '18 at 12:31
answered Aug 9 '18 at 8:15
HBruijnHBruijn
57.2k1190150
57.2k1190150
add a comment |
add a comment |
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.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
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
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
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
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