OpenVPN kliendi kasutamine Debianiga
OpenVPN ruuditud lahenduse kliendi seadistamine
Palas http://kuutorvaja.eenet.ee/wiki/OpenVPN_serveri_kasutamine_OpenBSD'ga#OpenVPN_ruuditud_lahenduse_serveri_seadistamine kirjeldatud serverile vastava kliendi seadistamiseks sobib kasutada sellist seadistusfaili
client dev tun0 proto udp remote 192.168.99.90 resolv-retry infinite nobind persist-key persist-tun ca /etc/openvpn/keys/VPN-TLA-ca.pem cert /etc/openvpn/keys/tla-martkask.vpn.loomaaed.tartu.ee-cert.pem key /etc/openvpn/keys/tla-martkask.vpn.loomaaed.tartu.ee-key.pem comp-lzo verb 3
Käivitamine toimub mõlemal juhul öeldes, kusjuures kui seadistusfailis on näidatud sertifikaatide asukohad suhtelise teega, peab asuma /etc/openvpn kataloogis
# cd /etc/openvpn # openvpn --config openvpn.conf
OpenVPN sillatud lahenduse kliendi seadistamine
OpenVPN kliendile vajalikud võtmed moodustatakse OpenVPN serveris ja kopeeritakse klienti, nii nagu kirjeldatud sertifikaatide punktis.
Kliendi poolel sobib sillatud režiimis kasutada sellist seadistusfaili
# cat /etc/openvpn/openvpn.conf client dev tap proto udp remote 172.16.2.1 resolv-retry infinite nobind persist-key persist-tun ca keys/ca.crt cert keys/kalake.crt key keys/kalake.key comp-lzo verb 3
Käivitamine toimub mõlemal juhul öeldes, kusjuures kui seadistusfailis on näidatud sertifikaatide asukohad suhtelise teega, peab asuma /etc/openvpn kataloogis
# cd /etc/openvpn # openvpn --config openvpn.conf
Eesti ID-kaardi kasutamine OpenVPN kliendiga
Selleks, et OpenVPN klient saaks ennast autentida ID-kaardi abil VPN kasutajana peab kliendi arvutis olema tehtud Eesti ID-kaardi kasutamiseks vajalikud ettevalmistused, nt nii nagu on kirjeldatud palas http://kuutorvaja.eenet.ee/wiki/Eesti_ID-kaardi_kasutamine_Debianiga
Ettevalmistuste edukuse kontrollimiseks sobib öelda nt
# openvpn --show-pkcs11-ids /usr/lib/opensc-pkcs11.so The following objects are available for use. Each object shown below may be used as parameter to --pkcs11-id option please remember to use single quote mark. Certificate DN: /C=EE/O=ESTEID/OU=authentication/CN=OOLBERG,IMRE,37003212713/SN=OOLBERG/GN=IMRE/serialNumber=37003212713 Serial: 48843168 Serialized id: AS\x20Sertifitseerimiskeskus/PKCS\x20\x2315\x20SCard/A0055728/ID\x2Dkaart\x20\x28PIN1\x2C\x20Isikutuvastus\x29/01 Certificate DN: /C=EE/O=ESTEID/OU=digital signature/CN=OOLBERG,IMRE,37003212713/SN=OOLBERG/GN=IMRE/serialNumber=37003212713 Serial: 48843169 Serialized id: AS\x20Sertifitseerimiskeskus/PKCS\x20\x2315\x20SCard/A0055728/ID\x2Dkaart\x20\x28PIN2\x2C\x20Allkirjastamine\x29/02
Kliendi poolel sobib kasutada nt sellist seadistusfaili, \ märgid on varjestatud
client dev tun proto udp remote 192.168.99.90 resolv-retry infinite nobind persist-key persist-tun ca /etc/openvpn/SK-CA.pem pkcs11-providers /usr/lib/opensc-pkcs11.so pkcs11-id "AS\\x20Sertifitseerimiskeskus/PKCS\\x20\\x2315\\x20SCard/A0055728/ID\\x2Dkaart\\x20\\x28PIN1\\x2C\\x20Isikutuvastus\\x29/01" comp-lzo verb 3
kus väärtus 'A0055728' on kasutajal personaalne, see kirjas nt füüsiliselt kaardil ja visuaalsel vaatlusel loetav.
Kasutamisel esitatakse kliendile selline logi, mh küsitakse PIN1 koodi
# openvpn --config openvpn.conf Sun Apr 26 12:07:12 2009 OpenVPN 2.1_rc11 i486-pc-linux-gnu [SSL] [LZO2] [EPOLL] [PKCS11] built on Sep 18 2008 Sun Apr 26 12:07:12 2009 PKCS#11: Adding PKCS#11 provider '/usr/lib/opensc-pkcs11.so' Sun Apr 26 12:07:17 2009 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info. Sun Apr 26 12:07:17 2009 /usr/bin/openssl-vulnkey -q -b 1024 -m <modulus omitted> [opensc-pkcs11] pkcs11-global.c:176:C_Initialize: C_Initialize(): Cryptoki already initialized Sun Apr 26 12:07:18 2009 LZO compression initialized Sun Apr 26 12:07:18 2009 Control Channel MTU parms [ L:1542 D:138 EF:38 EB:0 ET:0 EL:0 ] Sun Apr 26 12:07:18 2009 Data Channel MTU parms [ L:1542 D:1450 EF:42 EB:135 ET:0 EL:0 AF:3/1 ] Sun Apr 26 12:07:18 2009 Local Options hash (VER=V4): '41690919' Sun Apr 26 12:07:18 2009 Expected Remote Options hash (VER=V4): '530fdded' Sun Apr 26 12:07:18 2009 Socket Buffers: R=[111616->131072] S=[111616->131072] Sun Apr 26 12:07:18 2009 UDPv4 link local: [undef] Sun Apr 26 12:07:18 2009 UDPv4 link remote: 192.168.10.199:1194 Sun Apr 26 12:07:18 2009 TLS: Initial packet from 192.168.10.199:1194, sid=eef2a782 22a5670e Sun Apr 26 12:07:18 2009 VERIFY OK: depth=2, /emailAddress=pki@sk.ee/C=EE/O=AS_Sertifitseerimiskeskus/CN=Juur-SK Sun Apr 26 12:07:18 2009 VERIFY OK: depth=1, /emailAddress=pki@sk.ee/C=EE/O=AS_Sertifitseerimiskeskus/OU=Sertifitseerimisteenused/serialNumber=1/CN=KLASS3-SK Sun Apr 26 12:07:18 2009 VERIFY OK: depth=0, /CN=vpn.loomaaed.tartu.ee/O=Tartu Loomaaed/L=Tartu/ST=Tartu/C=EE Enter ID-kaart (PIN1, Isikutuvastus) token Password: Sun Apr 26 12:07:29 2009 Data Channel Encrypt: Cipher 'BF-CBC' initialized with 128 bit key Sun Apr 26 12:07:29 2009 Data Channel Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Sun Apr 26 12:07:29 2009 Data Channel Decrypt: Cipher 'BF-CBC' initialized with 128 bit key Sun Apr 26 12:07:29 2009 Data Channel Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication Sun Apr 26 12:07:29 2009 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 1024 bit RSA Sun Apr 26 12:07:29 2009 [www.ria.ee] Peer Connection Initiated with 192.168.10.199:1194 Sun Apr 26 12:07:30 2009 SENT CONTROL [vpn.loomaaed.tartu.ee]: 'PUSH_REQUEST' (status=1) Sun Apr 26 12:07:30 2009 PUSH: Received control message: 'PUSH_REPLY,route 172.16.1.1,topology net30,ping 10,ping-restart 120,ifconfig 172.16.1.6 172.16.1.5' Sun Apr 26 12:07:30 2009 OPTIONS IMPORT: timers and/or timeouts modified Sun Apr 26 12:07:30 2009 OPTIONS IMPORT: --ifconfig/up options modified Sun Apr 26 12:07:30 2009 OPTIONS IMPORT: route options modified Sun Apr 26 12:07:30 2009 ROUTE default_gateway=192.168.10.254 Sun Apr 26 12:07:30 2009 TUN/TAP device tun1 opened Sun Apr 26 12:07:30 2009 TUN/TAP TX queue length set to 100 Sun Apr 26 12:07:30 2009 /sbin/ifconfig tun1 172.16.1.6 pointopoint 172.16.1.5 mtu 1500 [opensc-pkcs11] pkcs11-global.c:176:C_Initialize: C_Initialize(): Cryptoki already initialized Sun Apr 26 12:07:30 2009 /sbin/route add -net 172.16.1.1 netmask 255.255.255.255 gw 172.16.1.5 [opensc-pkcs11] pkcs11-global.c:176:C_Initialize: C_Initialize(): Cryptoki already initialized Sun Apr 26 12:07:30 2009 Initialization Sequence Completed