Connect Linux to Synology nas
Posted: Mon Dec 30, 2013 1:20 pm
Hello after struggeling 2 days, im gonne ask some help and hope somebody wants to help me.
the following have i tried to get connection
http://forum.synology.com...rtificates_for_connecting
ave make folders
follow this rule :
openssl req -nodes -new -x509 -keyout my-ca.key -out my-ca.crt -days 3650
then i got stucked on the next rule
openssl ca -out syn.crt -in syn.csr.
he cant find cakey.pem
thru another topic i found the following rule
openssl req -new -x509 -extensions v3_ca -keyout demoCA/private/cakey.pem -out cacert.pem -days 3650
root will be generated the file cacert.pem (moved to the private folder
after that the following rules worked
server
openssl req -nodes -new -keyout syn.key -out syn.csr (create private key)
openssl ca -out syn.crt -in syn.csr (create a public key certificate and sign it)
client
openssl req -nodes -new -keyout client.key -out client.csr
openssl ca -out client.crt -in client.csr
this generated the following files
client.crt
client.csr
client.key
syn.crt
syn.csr
syn.key
cacert.pem
cakey.pem
my-ca.crt
the following files should go to the openvpn client : my-ca.crt client.crt en client.key en dh1024.pem (last file is a key fole of the synology.
after that changed the /usr/syno/etc/packages/VPNCenter/openvpn/openvpn.conf file, to the new syn.key syn.crt en my-ca.crt. services started.
CLient config zis as follow
client
dev tun
proto udp
remote 192.168.11.101 1194
redirect-gateway
persist-key
persist-tun
comp-lzo
dh /etc/openvpn/dh1024.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.key
key /etc/openvpn/client.crt
But if i start on the client i see the following error
Mon Dec 30 12:38:32 2013 OpenVPN 2.1.3 mipsel-oe-linux [SSL] [LZO2] [EPOLL] buil
t on May 9 2013
Mon Dec 30 12:38:32 2013 IMPORTANT: OpenVPN's default port number is now 1194, b
ased on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earl
ier used 5000 as the default port.
Mon Dec 30 12:38:32 2013 WARNING: No server certificate verification method has
been enabled. See http://openvpn.net/howto.html#mitm for more info.
Mon Dec 30 12:38:32 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or hig
her to call user-defined scripts or executables
Mon Dec 30 12:38:32 2013 Cannot load certificate file /etc/openvpn/client.key: e
rror:0906D06C:PEM routines:PEM_read_bio:no start line: error:140AD009:SSL routin
es:SSL_CTX_use_certificate_file:PEM lib
Mon Dec 30 12:38:32 2013 Exiting
Added just now the remote-cert-tls server in the client.conf to avoid the error "No server certificate verification "
but still i would start. anyone know what i did wrong ?
Kind regards
Peter
the following have i tried to get connection
http://forum.synology.com...rtificates_for_connecting
ave make folders
follow this rule :
openssl req -nodes -new -x509 -keyout my-ca.key -out my-ca.crt -days 3650
then i got stucked on the next rule
openssl ca -out syn.crt -in syn.csr.
he cant find cakey.pem
thru another topic i found the following rule
openssl req -new -x509 -extensions v3_ca -keyout demoCA/private/cakey.pem -out cacert.pem -days 3650
root will be generated the file cacert.pem (moved to the private folder
after that the following rules worked
server
openssl req -nodes -new -keyout syn.key -out syn.csr (create private key)
openssl ca -out syn.crt -in syn.csr (create a public key certificate and sign it)
client
openssl req -nodes -new -keyout client.key -out client.csr
openssl ca -out client.crt -in client.csr
this generated the following files
client.crt
client.csr
client.key
syn.crt
syn.csr
syn.key
cacert.pem
cakey.pem
my-ca.crt
the following files should go to the openvpn client : my-ca.crt client.crt en client.key en dh1024.pem (last file is a key fole of the synology.
after that changed the /usr/syno/etc/packages/VPNCenter/openvpn/openvpn.conf file, to the new syn.key syn.crt en my-ca.crt. services started.
CLient config zis as follow
client
dev tun
proto udp
remote 192.168.11.101 1194
redirect-gateway
persist-key
persist-tun
comp-lzo
dh /etc/openvpn/dh1024.pem
ca /etc/openvpn/ca.crt
cert /etc/openvpn/client.key
key /etc/openvpn/client.crt
But if i start on the client i see the following error
Mon Dec 30 12:38:32 2013 OpenVPN 2.1.3 mipsel-oe-linux [SSL] [LZO2] [EPOLL] buil
t on May 9 2013
Mon Dec 30 12:38:32 2013 IMPORTANT: OpenVPN's default port number is now 1194, b
ased on an official port number assignment by IANA. OpenVPN 2.0-beta16 and earl
ier used 5000 as the default port.
Mon Dec 30 12:38:32 2013 WARNING: No server certificate verification method has
been enabled. See http://openvpn.net/howto.html#mitm for more info.
Mon Dec 30 12:38:32 2013 NOTE: OpenVPN 2.1 requires '--script-security 2' or hig
her to call user-defined scripts or executables
Mon Dec 30 12:38:32 2013 Cannot load certificate file /etc/openvpn/client.key: e
rror:0906D06C:PEM routines:PEM_read_bio:no start line: error:140AD009:SSL routin
es:SSL_CTX_use_certificate_file:PEM lib
Mon Dec 30 12:38:32 2013 Exiting
Added just now the remote-cert-tls server in the client.conf to avoid the error "No server certificate verification "
but still i would start. anyone know what i did wrong ?
Kind regards
Peter