CentOS 7 - Cannot start OpenVPN Access Server

11,973

Solution 1

Running on Amazon Linux 2016.03 using this package in order to get the server running after the rpm install succeeded, I needed to:

sudo ln -s /sbin/ifconfig /usr/sbin/ifconfig

The reason openvpnas couldn't execute ifconfig, is because it was trying to run /usr/sbin/ifconfig. The symbolic link fixed it.

Solution 2

For the message "Address already in use", I think it's because https listen also on TCP port 443.

Solution 3

I have solved this problem and I just solve like this:

[root@linux1 openvpn]# vim server.conf
## Notify the client that when the server restarts so it
## can automatically reconnect.
;explicit-exit-notify 1

[root@linux1 openvpn]# systemctl restart openvpn@server

[root@linux1 openvpn]# systemctl status openvpn@server
● [email protected] - OpenVPN Robust And Highly Flexible Tunneling Application On server
   Loaded: loaded (/usr/lib/systemd/system/[email protected]; disabled; vendor preset: disabled)
   Active: active (running) since Sun 2017-02-05 20:33:57 ICT; 13s ago
  Process: 11837 ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=0/SUCCESS)
 Main PID: 11838 (openvpn)
   CGroup: /system.slice/system-openvpn.slice/[email protected]
           └─11838 /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/ser...

Feb 05 20:33:57 linux1 openvpn[11838]: /usr/sbin/ip link set dev tun0 up mt...00
Feb 05 20:33:57 linux1 systemd[1]: Started OpenVPN Robust And Highly Flexib...r.
Feb 05 20:33:57 linux1 openvpn[11838]: /usr/sbin/ip addr add dev tun0 local....2
Feb 05 20:33:57 linux1 openvpn[11838]: /usr/sbin/ip route add 10.8.0.0/24 v....2
Feb 05 20:33:57 linux1 openvpn[11838]: UDPv4 link local (bound): [undef]
Feb 05 20:33:57 linux1 openvpn[11838]: UDPv4 link remote: [undef]
Feb 05 20:33:57 linux1 openvpn[11838]: MULTI: multi_init called, r=256 v=256
Feb 05 20:33:57 linux1 openvpn[11838]: IFCONFIG POOL: base=10.8.0.4 size=62...=0
Feb 05 20:33:57 linux1 openvpn[11838]: IFCONFIG POOL LIST
Feb 05 20:33:57 linux1 openvpn[11838]: Initialization Sequence Completed
Hint: Some lines were ellipsized, use -l to show in full.
Share:
11,973

Related videos on Youtube

J.W.F.
Author by

J.W.F.

Updated on September 18, 2022

Comments

  • J.W.F.
    J.W.F. almost 2 years

    I have been trying to install the OpenVPN Access Server on my CentOS 7 VPS. However, I have been running into a number of problems.

    Initially, I had followed this DigitalOcean guide, but after I had problems using that, I later found out that I meant to install the Access Server. I found this DigitalOcean guide for CentOS 6.5, and just adapted it to CentOS 7.

    I'm beginning to wonder if following the instructions of the two different guides is what has caused my problems. I am able to start the service via command line, but I am not able to start it via the web interface.

    $ sudo systemctl status [email protected]
    [email protected] - OpenVPN Robust And Highly Flexible Tunneling Application On server
       Loaded: loaded (/usr/lib/systemd/system/[email protected]; enabled)
       Active: active (running) since Thu 2015-03-05 08:12:53 EST; 3s ago
      Process: 1738 ExecStart=/usr/sbin/openvpn --daemon --writepid /var/run/openvpn/%i.pid --cd /etc/openvpn/ --config %i.conf (code=exited, status=0/SUCCESS)
     Main PID: 1745 (openvpn)
       CGroup: /system.slice/system-openvpn.slice/[email protected]
               └─1745 /usr/sbin/openvpn --daemon --writepid /var/run/openvpn/server.pid --cd /etc/openvpn/ --config server.conf
    
    Mar 05 08:12:53 arguru systemd[1]: Failed to read PID from file /var/run/openvpn/server.pid: Invalid argument
    Mar 05 08:12:53 arguru openvpn[1745]: GID set to nobody
    Mar 05 08:12:53 arguru openvpn[1745]: UID set to nobody
    Mar 05 08:12:53 arguru openvpn[1745]: UDPv4 link local (bound): [undef]
    Mar 05 08:12:53 arguru openvpn[1745]: UDPv4 link remote: [undef]
    Mar 05 08:12:53 arguru openvpn[1745]: MULTI: multi_init called, r=256 v=256
    Mar 05 08:12:53 arguru openvpn[1745]: IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
    Mar 05 08:12:53 arguru openvpn[1745]: IFCONFIG POOL LIST
    Mar 05 08:12:53 arguru openvpn[1745]: Initialization Sequence Completed
    Mar 05 08:12:53 arguru systemd[1]: Started OpenVPN Robust And Highly Flexible Tunneling Application On server.
    

    However, from the web panel, I receive this error. My OpenVPN Web Interface

    I have tried searching multiple different resources about this, and some said the issue was that the web interface was not starting the VPN as root, which is why the ifconfig error occurred, and the second error regarding the binding failed only happens when I start OpenVPN via command line.

    I realize I probably made some mistakes setting this up, but I want to know how I can fix this now without reinstalling my entire operating system (this VPS is for my own learning and experimentation). Any help is appreciated!

  • J.W.F.
    J.W.F. over 9 years
    Thanks for the answer, Luc! I actually found out yesterday that the issue was two things. (1) I had two implementations of OpenVPN running, one of the command line version and one of the access panel. (2) I did not have net-tools installed, as I was running a minimalistic install of CentOS, which is where the issue about ifconfig came about. I will post an updated answer soon, when I am not on my phone!
  • J.W.F.
    J.W.F. over 9 years
    As soon as I installed net-tools and removed the second install of OpenVPN, my problem was instantly solved and the VPN is now running.
  • user214638
    user214638 over 7 years
    I disable this link in # server.conf (;explicit-exit-notify 1)