1

Temat: Klient open.vpn na gargoyle

Witam,
posiadam serwer VPN postawiony na VPS i chciałbym wklepać konfiga do klienta w gargoyle.
Serwer stawiałem na podstawie poradnika więc przyznaje, ze wiedzy w tym temacie brakuje.

Działający na windowsowym OpenVPN GUI konfig wygląda tak:


client
port 1111
remote 217.61.1.233
comp-lzo yes
dev tun
proto udp
nobind
auth-nocache
persist-key
persist-tun
verb 2
key-direction 1
<ca>
-----BEGIN CERTIFICATE-----
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
-----END PRIVATE KEY-----
</key>

W Gargoyle wybrałem ręczną konfiguracje i utknąłem na "algorytmie szyfrującym".
Podpowiedzcie co mam wybrać z tejże listy?

2

Odp: Klient open.vpn na gargoyle

Tu nie jest określony, więc zakładając że serwer obsługuje "wszystko" - wybierz jeden z dostępnych.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

3

Odp: Klient open.vpn na gargoyle

podczas próby zapisania zmian wywala "nie można znaleźć pliku konfiguracji"

4

Odp: Klient open.vpn na gargoyle

Taki komunikat pojawia się jak nie uzupełniłeś pól z certyfikatami.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

5

Odp: Klient open.vpn na gargoyle

teraz mam info, że nie zostało nawiązane połączenia z serwerem vpn

6

Odp: Klient open.vpn na gargoyle

To już patrz w logach co się dzieje.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

7

Odp: Klient open.vpn na gargoyle

Sam sobie nie poradzę.
Może ktoś zerknie na wycinek z loga i podpowie:

Mon Sep 26 19:49:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:49:00 2016 daemon.err openvpn(custom_config)[10067]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:49:00 2016 daemon.warn openvpn(custom_config)[10067]: Use --help for more information.
Mon Sep 26 19:50:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:50:00 2016 daemon.err openvpn(custom_config)[10089]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:50:00 2016 daemon.warn openvpn(custom_config)[10089]: Use --help for more information.
Mon Sep 26 19:51:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:51:00 2016 daemon.err openvpn(custom_config)[10112]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:51:00 2016 daemon.warn openvpn(custom_config)[10112]: Use --help for more information.
Mon Sep 26 19:51:28 2016 daemon.err uhttpd[1708]: tr: short write
Mon Sep 26 19:51:29 2016 daemon.err openvpn(custom_config)[10184]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:51:29 2016 daemon.warn openvpn(custom_config)[10184]: Use --help for more information.
Mon Sep 26 19:52:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:52:00 2016 daemon.err openvpn(custom_config)[10311]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:52:00 2016 daemon.warn openvpn(custom_config)[10311]: Use --help for more information.
Mon Sep 26 19:53:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:53:00 2016 daemon.err openvpn(custom_config)[10364]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:53:00 2016 daemon.warn openvpn(custom_config)[10364]: Use --help for more information.
Mon Sep 26 19:53:02 2016 daemon.err uhttpd[1708]: tr: short write
Mon Sep 26 19:53:03 2016 daemon.err openvpn(custom_config)[10436]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:53:03 2016 daemon.warn openvpn(custom_config)[10436]: Use --help for more information.
Mon Sep 26 19:54:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:54:00 2016 daemon.err openvpn(custom_config)[10595]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:54:00 2016 daemon.warn openvpn(custom_config)[10595]: Use --help for more information.
Mon Sep 26 19:54:23 2016 daemon.err uhttpd[1708]: tr: short write
Mon Sep 26 19:54:24 2016 daemon.err openvpn(custom_config)[10667]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:54:24 2016 daemon.warn openvpn(custom_config)[10667]: Use --help for more information.
Mon Sep 26 19:55:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:55:00 2016 daemon.err openvpn(custom_config)[10826]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:55:00 2016 daemon.warn openvpn(custom_config)[10826]: Use --help for more information.
Mon Sep 26 19:55:10 2016 daemon.err uhttpd[1708]: tr: short write
Mon Sep 26 19:55:11 2016 daemon.err openvpn(custom_config)[10898]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:55:11 2016 daemon.warn openvpn(custom_config)[10898]: Use --help for more information.
Mon Sep 26 19:55:14 2016 daemon.info hostapd: wlan0: STA 5c:cf:7f:1c:26:cb WPA: group key handshake completed (RSN)
Mon Sep 26 19:55:14 2016 daemon.info hostapd: wlan0: STA 00:23:4e:21:ae:45 WPA: group key handshake completed (RSN)
Mon Sep 26 19:55:14 2016 daemon.info hostapd: wlan0: STA 5c:cf:7f:16:ef:83 WPA: group key handshake completed (RSN)
Mon Sep 26 19:55:14 2016 daemon.info hostapd: wlan0: STA 5c:cf:7f:1c:87:c2 WPA: group key handshake completed (RSN)
Mon Sep 26 19:55:14 2016 daemon.info hostapd: wlan0: STA e8:50:8b:31:07:16 WPA: group key handshake completed (RSN)
Mon Sep 26 19:56:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 19:56:00 2016 daemon.err openvpn(custom_config)[11027]: Options error: You must define TUN/TAP device (--dev)
Mon Sep 26 19:56:00 2016 daemon.warn openvpn(custom_config)[11027]: Use --help for more information.
Success

8

Odp: Klient open.vpn na gargoyle

dev tun nie dodałeś chyba do konfiga bo to pluje się w logach.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

9

Odp: Klient open.vpn na gargoyle

Teraz pluje tym jadem:

Mon Sep 26 20:07:01 2016 daemon.err openvpn(custom_config)[12268]: Options error: Parameter ca_file can only be specified in TLS-mode, i.e. where --tls-server or --tls-client is also specified.
Mon Sep 26 20:07:01 2016 daemon.warn openvpn(custom_config)[12268]: Use --help for more information.
Success

10

Odp: Klient open.vpn na gargoyle

Pokaż w końcu cały konfig klienta jaki zrobiłeś.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

11 (edytowany przez okos 2016-09-26 19:20:16)

Odp: Klient open.vpn na gargoyle

remote 217.61.1.233 1111
proto udp
dev tun
cipher AES-128-CBC
ca    /etc/openvpn/grouter_client_oktcysactimr_ca.crt
cert  /etc/openvpn/grouter_client_oktcysactimr.crt
key   /etc/openvpn/grouter_client_oktcysactimr.key

Takie coś się wygenerowało, ja tylko dopisałem "dev tun"
Oczywiście klucze wklejałem w odpowiednie ramki.

12

Odp: Klient open.vpn na gargoyle

"Się wygenerowało" A gdzie pozostałe opcje z konfga? miałeś:
client
comp-lzo yes
dev tun
proto udp
nobind
auth-nocache
persist-key
persist-tun
verb 2
key-direction 1

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

13 (edytowany przez okos 2016-09-26 19:27:32)

Odp: Klient open.vpn na gargoyle

Myślałem, że skoro robię to w GUI to sie doda z automatu.......jak widać sie nie dodało

teraz mam taki konfig ale jeszcze nie lata:

client
remote 217.61.1.233 1111
comp-lzo yes
dev tun
proto udp
nobind
auth-nocache
persist-key
persist-tun
verb 2
key-direction 1

cipher AES-128-CBC
ca    /etc/openvpn/grouter_client_oktcysactimr_ca.crt
cert  /etc/openvpn/grouter_client_oktcysactimr.crt
key   /etc/openvpn/grouter_client_oktcysactimr.key

14

Odp: Klient open.vpn na gargoyle

Ale jakim sposobem miało się dodać samo? Skąd "samo" miało wiedzieć jakie opcje klienta są potrzebne? smile

Znów patrz w logach co się dzieje.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

15

Odp: Klient open.vpn na gargoyle

Teraz to:

Mon Sep 26 20:27:00 2016 daemon.notice openvpn(custom_config)[13195]: OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on May 21 2016
Mon Sep 26 20:27:00 2016 daemon.notice openvpn(custom_config)[13195]: library versions: OpenSSL 1.0.2h  3 May 2016, LZO 2.08
Mon Sep 26 20:27:00 2016 daemon.warn openvpn(custom_config)[13195]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mon Sep 26 20:27:00 2016 daemon.err openvpn(custom_config)[13195]: Cannot load certificate file /etc/openvpn/grouter_client_oktcysactimr.crt: error:0906D06C:lib(9):func(109):reason(108): error:140AD009:lib(20):func(173):reason(9)
Mon Sep 26 20:27:00 2016 daemon.notice openvpn(custom_config)[13195]: Exiting due to fatal error
Success

16

Odp: Klient open.vpn na gargoyle

Certyfikat który umieściłeś w pliku - musiałeś zepsuć jego format, bo drze się że nie może go załadować.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

17

Odp: Klient open.vpn na gargoyle

Rozumiem, że chodzi o certyfikat klienta, ale ja skopiowałem go z działającego na windowsie konfigu klienta, więc musi być w porządku.

18

Odp: Klient open.vpn na gargoyle

Ale to jest kwestia linii pustych (ich braku), wcięć ew końców linii.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

19

Odp: Klient open.vpn na gargoyle

może to wklepać przez ssh?
ale jaki edytor do tego bo vim jest "średni"

20

Odp: Klient open.vpn na gargoyle

Jest nano, po prostu zainstaluj go sobie.  Spójrz w pliki /etc/openvpn/grouter_client_oktcysactimr_ca.crt itd i zobacz czy nie zostawiłeś tam pustych linii itd.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

21

Odp: Klient open.vpn na gargoyle

Rzeczywiście brakowało kilku znaków na końcu linii.
Wyedytowałem vim-em ale :

Mon Sep 26 21:14:00 2016 user.notice root: openvpn stopped, restarting
Mon Sep 26 21:14:00 2016 daemon.notice openvpn(custom_config)[4165]: OpenVPN 2.3.6 mips-openwrt-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [MH] [IPv6] built on May 21 2016
Mon Sep 26 21:14:00 2016 daemon.notice openvpn(custom_config)[4165]: library versions: OpenSSL 1.0.2h  3 May 2016, LZO 2.08
Mon Sep 26 21:14:00 2016 daemon.warn openvpn(custom_config)[4165]: WARNING: No server certificate verification method has been enabled.  See http://openvpn.net/howto.html#mitm for more info.
Mon Sep 26 21:14:00 2016 daemon.err openvpn(custom_config)[4165]: Cannot load certificate file /etc/openvpn/grouter_client_oktcysactimr.crt: error:0906D06C:lib(9):func(109):reason(108): error:140AD009:lib(20):func(173):reason(9)
Mon Sep 26 21:14:00 2016 daemon.notice openvpn(custom_config)[4165]: Exiting due to fatal error
Success

22

Odp: Klient open.vpn na gargoyle

/etc/openvpn/grouter_client_oktcysactimr.crt nie może załadować...

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

23 (edytowany przez okos 2016-09-26 21:27:13)

Odp: Klient open.vpn na gargoyle

Guru, co proponujesz w tej sytuacji?
Przywrócenie routera do fabryki i ustawienie wszystkiego od nowa może pomóc ?

24

Odp: Klient open.vpn na gargoyle

Nie. Przenieś poprawnie certyfikaty.

Masz niepotrzebny router, uszkodzony czy nie - chętnie przygarnę go.

25

Odp: Klient open.vpn na gargoyle

W porządku, pomogła metoda załadowania pojedynczych plików konfiguracyjnych smile
Otrzymałem adres  IP: 10.8.0.6 ale teraz czeka mnie chyba dalsza zabawa bo brak internetu.
Jakie zmiany jeszcze do poczynienia aby pojawił ?