Hello everyone, Im new here and new with OpenVPN.
I have installed openvpn server on my Centos7 by:
https://www.cyberciti.biz/faq/centos-7-0-set-up-openvpn-server-in-5-minutes/
After install I run command systemctl start openvpn@server I got error like below. I think there is no any other openvpn services
Oct 15 10:07:44 psc-serv systemd: Cannot add dependency job for unit firewalld.service, ignoring: Unit is masked.
Oct 15 10:07:44 psc-serv systemd: Starting OpenVPN Robust And Highly Flexible Tunneling Application On server...
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 OpenVPN 2.4.9 x86_64-redhat-linux-gnu [Fedora EPEL patched] [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Apr 24 2020
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 library versions: OpenSSL 1.0.2k-fips 26 Jan 2017, LZO 2.06
Oct 15 10:07:44 psc-serv systemd: Started OpenVPN Robust And Highly Flexible Tunneling Application On server.
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 CRL: loaded 1 CRLs from file crl.pem
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 ECDH curve prime256v1 added
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Outgoing Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Outgoing Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Incoming Control Channel Encryption: Cipher 'AES-256-CTR' initialized with 256 bit key
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Incoming Control Channel Encryption: Using 256 bit message hash 'SHA256' for HMAC authentication
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 TUN/TAP device tun1 opened
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 TUN/TAP TX queue length set to 100
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 /sbin/ip link set dev tun1 up mtu 1500
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 /sbin/ip addr add dev tun1 10.8.0.1/24 broadcast 10.8.0.255
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8738] manager: (tun1): new Tun device (/org/freedesktop/NetworkManager/Devices/8)
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Could not determine IPv4/IPv6 protocol. Using AF_INET
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8764] device (tun1): state change: unmanaged -> unavailable (reason 'connection-assumed', sys-iface-state: 'external')
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Socket Buffers: R=[212992->212992] S=[212992->212992]
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 TCP/UDP: Socket bind failed on local address [AF_INET][undef]:1194: Address already in use (errno=98)
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Exiting due to fatal error
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 Closing TUN/TAP interface
Oct 15 10:07:44 psc-serv openvpn: Thu Oct 15 10:07:44 2020 /sbin/ip addr del dev tun1 10.8.0.1/24
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8783] keyfile: add connection /var/run/NetworkManager/system-connections/tun1.nmconnection (f9da174f-9335-4b2a-a508-263be5a0ee9e,"tun1")
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8786] device (tun1): state change: unavailable -> disconnected (reason 'connection-assumed', sys-iface-state: 'external')
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8790] device (tun1): Activation: starting connection 'tun1' (f9da174f-9335-4b2a-a508-263be5a0ee9e)
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8792] device (tun1): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'external')
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8812] device (tun1): state change: prepare -> config (reason 'none', sys-iface-state: 'external')
Oct 15 10:07:44 psc-serv NetworkManager[867]: <info> [1602749264.8817] device (tun1): state change: config -> unmanaged (reason 'unmanaged', sys-iface-state: 'removed')
Oct 15 10:07:44 psc-serv systemd: openvpn@server.service: main process exited, code=exited, status=1/FAILURE
Oct 15 10:07:44 psc-serv systemd: Unit openvpn@server.service entered failed state.
Oct 15 10:07:44 psc-serv systemd: openvpn@server.service failed.
What I tried to do?
Command lsof -i | grep openvpn shows:
openvpn 4345 nobody 6u IPv4 480484 0t0 UDP *:openvpn
I tried kill -9 4345 and restart openvpn@service, but problem still is.
My ifconfig output:
[root@psc-serv openvpn]# ifconfig
eno1: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.8.101 netmask 255.255.255.0 broadcast 192.168.8.255
inet6 fd7c:942a:1c27:d000:c9f0:d3a4:1696:483e prefixlen 64 scopeid 0x0<global>
inet6 fe80::6c4d:44f9:c786:48b8 prefixlen 64 scopeid 0x20<link>
ether e0:07:1b:ff:da:4d txqueuelen 1000 (Ethernet)
RX packets 2462802 bytes 2483455326 (2.3 GiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2717996 bytes 3373737608 (3.1 GiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 16 memory 0xdf100000-df120000
enp1s0f0: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:26:55:d8:8a:ac txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 18 memory 0xdf0a0000-df0c0000
enp1s0f1: flags=4099<UP,BROADCAST,MULTICAST> mtu 1500
ether 00:26:55:d8:8a:ad txqueuelen 1000 (Ethernet)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 0 bytes 0 (0.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
device interrupt 19 memory 0xdf040000-df060000
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 65536
inet 127.0.0.1 netmask 255.0.0.0
inet6 ::1 prefixlen 128 scopeid 0x10<host>
loop txqueuelen 1000 (Local Loopback)
RX packets 222 bytes 15100 (14.7 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 222 bytes 15100 (14.7 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
tun0: flags=4305<UP,POINTOPOINT,RUNNING,NOARP,MULTICAST> mtu 1500
inet 10.8.0.1 netmask 255.255.255.0 destination 10.8.0.1
inet6 fe80::6039:3701:30f:6fc2 prefixlen 64 scopeid 0x20<link>
unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 txqueuelen 100 (UNSPEC)
RX packets 0 bytes 0 (0.0 B)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 3 bytes 144 (144.0 B)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
[root@psc-serv openvpn]#
Im very intrested, why openvpn created tun0, but in the logs refer to tun1?
Output of server.conf:
port 1194
proto udp
dev tun
user nobody
group nobody
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "redirect-gateway def1 bypass-dhcp"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key 0
crl-verify crl.pem
ca ca.crt
cert server_zixbgjNGSC10rYC6.crt
key server_zixbgjNGSC10rYC6.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
verb 3
I will be greatfull for any tips.
Your faithfully,
Przemek.