M
M
mr_blond972015-07-15 16:31:46
linux
mr_blond97, 2015-07-15 16:31:46

Centos 7, why won't openvpn client start?

Trying to install openvpn client on centos7:
# systemctl start [email protected]
Job for [email protected] failed. See 'systemctl status [email protected]' and 'journalctl -xn' for details.
# systemctl status [email protected]
[email protected] - OpenVPN service openvpn
Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled)
Active: failed (Result: exit-code) since Wed 2015-07-15 16:25:46 FET; 14s ago
Process: 9523 ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=1/FAILURE)
Jul 15 16:25:46 erp systemd[1]: Starting OpenVPN service openvpn...
Jul 15 16:25:46 erp systemd[1]: [email protected]: control process exited, code=exited status=1
Jul 15 16:25:46 erp systemd[1]: Failed to start OpenVPN service openvpn.
Jul 15 16:25:46 erp systemd[1]: Unit [email protected] entered failed state.
What could be the cause of the problem?

Answer the question

In order to leave comments, you need to log in

6 answer(s)
A
Andrey Burov, 2015-07-15
@BuriK666

see openvpn log

V
Vladimir, 2015-07-15
@rostel

increase the talkativeness of the log
and look in it

R
Ruslan Fedoseev, 2015-07-15
@martin74ua

module loaded? tun device is there?

Y
younghacker, 2015-08-07
@younghacker

Everything you need has been said above, I just add a little practice.
In the root session:
disable SELinux
check that it is disabled
Configure the logs /etc/openvpn/your-vpn.conf

log-append  /var/log/openvpn.log
verb 5

then run openvpn and see what happens in the log
, also errors indicating a problem can be in /var/log/messages
If the problem is in SELinux, then allow opening ports (for the config that the server will generate), read configs and write log and status files.
Show SELinux permissions for files:
and for ports (required for the server)
Add file exclusions:
semanage fcontext -t openvpn_etc_t -a '/etc/openvpn(/.*)?'
semanage fcontext -t openvpn_etc_rw_t -a '/etc/openvpn/ipp.txt'
semanage fcontext -t openvpn_var_log_t -a '/var/log/openvpn.*'
restorecon -v /etc/openvpn/
restorecon -v /var/log/

Adding port exceptions:
semanage port -a -t openvpn_port_t -p tcp ПОРТ
semanage port -a -t openvpn_port_t -p udp ПОРТ

semanage is in the libsemanage-python package

T
turock, 2016-04-01
@turock

systemctl start [email protected]
You are trying to start a client called openvpn. Is that what your config is called?
What's after @ is the name of the config, i.e. if your config is called office.conf , then you need to run it
systemctl start [email protected]

A
Andrew, 2017-06-09
@Brujerizmo

The correct answer is mkdir /var/run/openvpn/

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question