Buongiorno a tutti,
sono nuovo del forum,
sono riuscito ad installare e configurare OpenVPN, ho ancora qualche problemino con OpenSSL, ma sono sulla buona strada.
Di seguito la procedura di installazione di OpenVPN, OpenSSL e Easy-RSA:
wget -P /tmp http://brcm63xx-tch.ddns.net/base/libltdl_2.4-1_brcm63xx-tch.ipk
opkg install /tmp/libltdl_2.4-1_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/packages/collectd_5.4.2-2_brcm63xx-tch.ipk
opkg install /tmp/collectd_5.4.2-2_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/packages/collectd-mod-openvpn_5.4.2-2_brcm63xx-tch.ipk
opkg install /tmp/collectd-mod-openvpn_5.4.2-2_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/base/openssl-util_1.0.2g-1_brcm63xx-tch.ipk
opkg install /tmp/openssl-util_1.0.2g-1_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/base/openvpn-easy-rsa_2013-01-30-2_brcm63xx-tch.ipk
opkg install /tmp/openvpn-easy-rsa_2013-01-30-2_brcm63xx-tch.ipk
cp /etc/easy-rsa/openssl-1.0.0.cnf /etc/easy-rsa/openssl.cnf
wget -P /tmp http://brcm63xx-tch.ddns.net/base/kmod-tun_3.4.11-rt19-1_brcm63xx-tch.ipk
opkg install --nodeps /tmp/kmod-tun_3.4.11-rt19-1_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/base/liblzo_2.08-1_brcm63xx-tch.ipk
opkg install /tmp/liblzo_2.08-1_brcm63xx-tch.ipk
wget -P /tmp http://brcm63xx-tch.ddns.net/base/openvpn-openssl_2.3.6-5_brcm63xx-tch.ipk
opkg install /tmp/openvpn-openssl_2.3.6-5_brcm63xx-tch.ipk
Con vi va aggiunta la seguente interfaccia sul config di network
vi /etc/config/network
config interface 'vpn0'
option ifname 'tap0'
option proto 'none'
option auto '1'
E la seguente regola sul firewall
vi /etc/config/firewall
config rule 'Allow_OpenVPN_Inbound'
option target 'ACCEPT'
option src '*'
option proto 'udp'
option dest_port '1194'
dopodiché va fatto il reload
/etc/init.d/network reload
/etc/init.d/firewall reload
Poi andiamo a creare le chiavi RSA:
pkitool --initca
pkitool --server my-server
pkitool my-client
openssl dhparam -out dh2048.pem 2048
Ma già qui nascono i primi problemi:
pkitool --server my-server
pkitool my-client
dovrebbero creare anche i certificati CRT, ma non li creano, quindi devo forzare la creazione con:
pkitool --sign my-client
pkitool --sign my-server
Ma il certificato my-server.crt viene creato con
X509v3 Extended Key Usage:
TLS Web Client Authentication
e non 'TLS Server Authentication'
Pertanto fallisce l'handshake all'apertura della connessione OpenVPN:
2017-10-29 20:02:37 VERIFY ERROR: depth=0, error=unsupported certificate purpose: C=US, ST=CA, L=SanFrancisco, O=Fort-Funston, OU=MyOrganizationalUnit, CN=my-server, name=EasyRSA, [email protected]
2017-10-29 20:02:37 OpenSSL: error:14090086:SSL routines:ssl3_get_server_certificate:certificate verify failed
Ciao Andrea