Hello.
I am trying to setup OpenVPN server on CentOS 6.5 VPS and connect to it with windows 7 client.
I am new to this so I looked up tutorials, everything I did was a mixture of these 3 tutorials, first one I followed to the letter, second and third just lookedup for cross refference.
https://webpatron.net/en/blog/sysadmin-notes/item/35-installing-configuring-and-using-openvpn-server-centos-6-6
http://geek-kb.com/install-and-configure-openvpn-centos-6-x/
https://www.digitalocean.com/community/tutorials/how-to-setup-and-configure-an-openvpn-server-on-centos-6
Please, any idea what is wrong here?
Client GUI output:
Fri Dec 18 17:46:01 2015 Warning: cannot open --log file: C:\Program Files\OpenVPN\log\client.log: Access is denied. (errno=5)
Fri Dec 18 17:46:01 2015 OpenVPN 2.3.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Dec 16 2015
Fri Dec 18 17:46:01 2015 library versions: OpenSSL 1.0.1q 3 Dec 2015, LZO 2.09
Fri Dec 18 17:46:01 2015 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Fri Dec 18 17:46:01 2015 Need hold release from management interface, waiting...
Fri Dec 18 17:46:02 2015 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Fri Dec 18 17:46:02 2015 MANAGEMENT: CMD 'state on'
Fri Dec 18 17:46:02 2015 MANAGEMENT: CMD 'log all on'
Fri Dec 18 17:46:02 2015 MANAGEMENT: CMD 'hold off'
Fri Dec 18 17:46:02 2015 MANAGEMENT: CMD 'hold release'
Fri Dec 18 17:46:02 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri Dec 18 17:46:02 2015 UDPv4 link local: [undef]
Fri Dec 18 17:46:02 2015 UDPv4 link remote: [AF_INET]5.231.220.219:1194
Fri Dec 18 17:46:02 2015 MANAGEMENT: >STATE:1450457162,WAIT,,,
Fri Dec 18 17:47:02 2015 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Dec 18 17:47:02 2015 TLS Error: TLS handshake failed
Fri Dec 18 17:47:02 2015 SIGUSR1[soft,tls-error] received, process restarting
Fri Dec 18 17:47:02 2015 MANAGEMENT: >STATE:1450457222,RECONNECTING,tls-error,,
Fri Dec 18 17:47:02 2015 Restart pause, 2 second(s)
Fri Dec 18 17:47:04 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri Dec 18 17:47:04 2015 UDPv4 link local: [undef]
Fri Dec 18 17:47:04 2015 UDPv4 link remote: [AF_INET]5.231.220.219:1194
Fri Dec 18 17:47:04 2015 MANAGEMENT: >STATE:1450457224,WAIT,,,
Fri Dec 18 17:48:04 2015 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Fri Dec 18 17:48:04 2015 TLS Error: TLS handshake failed
Fri Dec 18 17:48:04 2015 SIGUSR1[soft,tls-error] received, process restarting
Fri Dec 18 17:48:04 2015 MANAGEMENT: >STATE:1450457284,RECONNECTING,tls-error,,
Fri Dec 18 17:48:04 2015 Restart pause, 2 second(s)
Fri Dec 18 17:48:06 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Fri Dec 18 17:48:06 2015 UDPv4 link local: [undef]
Fri Dec 18 17:48:06 2015 UDPv4 link remote: [AF_INET]5.231.220.219:1194
Fri Dec 18 17:48:06 2015 MANAGEMENT: >STATE:1450457286,WAIT,,,
server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
comp-lzo
max-clients 100
user nobody
group nobody
persist-key
persist-tun
status /var/log/openvpn-status.log
log-append /var/log/openvpn.log
verb 3
openvpn.log
Fri Dec 18 16:12:49 2015 OpenVPN 2.3.8 i686-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Aug 4 2015
Fri Dec 18 16:12:49 2015 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.03
Fri Dec 18 16:12:49 2015 Diffie-Hellman initialized with 2048 bit key
Fri Dec 18 16:12:49 2015 Socket Buffers: R=[112640->131072] S=[112640->131072]
Fri Dec 18 16:12:49 2015 ROUTE_GATEWAY 5.231.220.1/255.255.255.0 IFACE=eth0 HWADDR=00:15:5d:00:4e:ee
Fri Dec 18 16:12:49 2015 TUN/TAP device tun0 opened
Fri Dec 18 16:12:49 2015 TUN/TAP TX queue length set to 100
Fri Dec 18 16:12:49 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Dec 18 16:12:49 2015 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 18 16:12:49 2015 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Fri Dec 18 16:12:49 2015 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Fri Dec 18 16:12:49 2015 GID set to nobody
Fri Dec 18 16:12:49 2015 UID set to nobody
Fri Dec 18 16:12:49 2015 UDPv4 link local (bound): [undef]
Fri Dec 18 16:12:49 2015 UDPv4 link remote: [undef]
Fri Dec 18 16:12:49 2015 MULTI: multi_init called, r=256 v=256
Fri Dec 18 16:12:49 2015 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Fri Dec 18 16:12:49 2015 IFCONFIG POOL LIST
Fri Dec 18 16:12:49 2015 Initialization Sequence Completed
Fri Dec 18 17:09:08 2015 event_wait : Interrupted system call (code=4)
Fri Dec 18 17:09:08 2015 /sbin/ip route del 10.8.0.0/24
RTNETLINK answers: Operation not permitted
Fri Dec 18 17:09:08 2015 ERROR: Linux route delete command failed: external program exited with error status: 2
Fri Dec 18 17:09:08 2015 Closing TUN/TAP interface
Fri Dec 18 17:09:08 2015 /sbin/ip addr del dev tun0 local 10.8.0.1 peer 10.8.0.2
RTNETLINK answers: Operation not permitted
Fri Dec 18 17:09:08 2015 Linux ip addr del failed: external program exited with error status: 2
Fri Dec 18 17:09:08 2015 SIGTERM[hard,] received, process exiting
Fri Dec 18 17:09:10 2015 OpenVPN 2.3.8 i686-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Aug 4 2015
Fri Dec 18 17:09:10 2015 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.03
Fri Dec 18 17:09:10 2015 Diffie-Hellman initialized with 2048 bit key
Fri Dec 18 17:09:10 2015 Socket Buffers: R=[112640->131072] S=[112640->131072]
Fri Dec 18 17:09:10 2015 ROUTE_GATEWAY 5.231.220.1/255.255.255.0 IFACE=eth0 HWADDR=00:15:5d:00:4e:ee
Fri Dec 18 17:09:10 2015 TUN/TAP device tun0 opened
Fri Dec 18 17:09:10 2015 TUN/TAP TX queue length set to 100
Fri Dec 18 17:09:10 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Dec 18 17:09:10 2015 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 18 17:09:10 2015 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Fri Dec 18 17:09:10 2015 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Fri Dec 18 17:09:10 2015 GID set to nobody
Fri Dec 18 17:09:10 2015 UID set to nobody
Fri Dec 18 17:09:10 2015 UDPv4 link local (bound): [undef]
Fri Dec 18 17:09:10 2015 UDPv4 link remote: [undef]
Fri Dec 18 17:09:10 2015 MULTI: multi_init called, r=256 v=256
Fri Dec 18 17:09:10 2015 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Fri Dec 18 17:09:10 2015 IFCONFIG POOL LIST
Fri Dec 18 17:09:10 2015 Initialization Sequence Completed
Fri Dec 18 17:22:22 2015 event_wait : Interrupted system call (code=4)
Fri Dec 18 17:22:22 2015 /sbin/ip route del 10.8.0.0/24
RTNETLINK answers: Operation not permitted
Fri Dec 18 17:22:22 2015 ERROR: Linux route delete command failed: external program exited with error status: 2
Fri Dec 18 17:22:22 2015 Closing TUN/TAP interface
Fri Dec 18 17:22:22 2015 /sbin/ip addr del dev tun0 local 10.8.0.1 peer 10.8.0.2
RTNETLINK answers: Operation not permitted
Fri Dec 18 17:22:22 2015 Linux ip addr del failed: external program exited with error status: 2
Fri Dec 18 17:22:22 2015 SIGTERM[hard,] received, process exiting
Fri Dec 18 17:22:24 2015 OpenVPN 2.3.8 i686-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Aug 4 2015
Fri Dec 18 17:22:24 2015 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.03
Fri Dec 18 17:22:24 2015 Diffie-Hellman initialized with 2048 bit key
Fri Dec 18 17:22:24 2015 Socket Buffers: R=[112640->131072] S=[112640->131072]
Fri Dec 18 17:22:24 2015 ROUTE_GATEWAY 5.231.220.1/255.255.255.0 IFACE=eth0 HWADDR=00:15:5d:00:4e:ee
Fri Dec 18 17:22:24 2015 TUN/TAP device tun0 opened
Fri Dec 18 17:22:24 2015 TUN/TAP TX queue length set to 100
Fri Dec 18 17:22:24 2015 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Fri Dec 18 17:22:24 2015 /sbin/ip link set dev tun0 up mtu 1500
Fri Dec 18 17:22:24 2015 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Fri Dec 18 17:22:24 2015 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Fri Dec 18 17:22:24 2015 GID set to nobody
Fri Dec 18 17:22:24 2015 UID set to nobody
Fri Dec 18 17:22:24 2015 UDPv4 link local (bound): [undef]
Fri Dec 18 17:22:24 2015 UDPv4 link remote: [undef]
Fri Dec 18 17:22:24 2015 MULTI: multi_init called, r=256 v=256
Fri Dec 18 17:22:24 2015 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Fri Dec 18 17:22:24 2015 IFCONFIG POOL LIST
Fri Dec 18 17:22:24 2015 Initialization Sequence Completed
iptables
# Generated by iptables-save v1.4.7 on Fri Dec 18 17:22:08 2015
*nat
:PREROUTING ACCEPT [11479:810270]
:POSTROUTING ACCEPT [460:30304]
:OUTPUT ACCEPT [460:30304]
-A POSTROUTING -s 10.8.0.0/24 -o eth0 -j MASQUERADE
-A POSTROUTING -o venet0 -j SNAT --to-source 5.231.220.219
COMMIT
# Completed on Fri Dec 18 17:22:08 2015
# Generated by iptables-save v1.4.7 on Fri Dec 18 17:22:08 2015
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [190342:26999625]
-A INPUT -p tcp -m tcp --dport 10090:10100 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 80 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 443 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 1234 -j ACCEPT
-A INPUT -p tcp -m tcp --dport 21 -j ACCEPT
-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7240,7241 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7240,7241 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7242,7243 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7242,7243 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7244,7245 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7244,7245 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7246,7247 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7246,7247 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7248,7249 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7248,7249 -j ACCEPT
-A INPUT -p tcp -m multiport --dports 7250,7251 -j ACCEPT
-A INPUT -p udp -m multiport --dports 7250,7251 -j ACCEPT
-A INPUT -p tcp -m state --state NEW -m tcp --dport 21 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -i venet0 -o tun0 -m state --state RELATED,ESTABLISHED -j ACCEPT
-A FORWARD -i tun0 -o venet0 -j ACCEPT
COMMIT
# Completed on Fri Dec 18 17:22:08 2015