1

Temat: MR3420 openvpn client

Ćwiczenie jest takie: na N16 ddwrt mam postawiony serwer openvpn i chciałbym się do niego podłączać za pomocą openwrt z MR3420.
Przejrzałem HOWTO http://eko.one.pl/?p=openwrt-openvpn, ale nie znalazłem odpowiedzi na to jak skonfigurować openwrt aby działał w roli klienta openvpn.
Czy jest gdzieś takie HOWTO?

2

Odp: MR3420 openvpn client

Coś źle czytałeś. Masz tam konfigurację klienta, po prostu wkładasz ją do pliku konfiguracyjnego.

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

3

Odp: MR3420 openvpn client

Zainstalowałem http://eko.one.pl/forum/viewtopic.php?pid=21214#p21214,
potem http://eko.one.pl/?p=openwrt-openvpn
Jednak zatrzymuje się na instalacji openvpn:

root@Gargoyle:/tmp$ opkg install --verbosity=3 openvpn
opkg_conf_parse_file: Loading conf file /etc/opkg.conf.
pkg_hash_load_feeds:
pkg_hash_load_status_files:
pkg_info_preinstall_check: Updating file owner list.
pkg_hash_fetch_best_installation_candidate: Best installation candidate for openvpn:
pkg_hash_fetch_best_installation_candidate: apkg=openvpn nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding openvpn to providers.
pkg_hash_fetch_best_installation_candidate: Adding openvpn to providers.
pkg_hash_fetch_best_installation_candidate: openvpn arch=ar71xx arch_priority=10 version=2.1.4.
pkg_hash_fetch_best_installation_candidate: openvpn arch=ar71xx arch_priority=10 version=2.1.3.
pkg_hash_fetch_best_installation_candidate: openvpn arch=ar71xx arch_priority=10 version=2.1.4.
pkg_hash_fetch_best_installation_candidate: openvpn arch=ar71xx arch_priority=10 version=2.1.3.
pkg_hash_fetch_best_installation_candidate: Candidate: openvpn 2.1.3.
pkg_hash_fetch_best_installation_candidate: Candidate: openvpn 2.1.4.
pkg_hash_fetch_best_installation_candidate: 2 matching pkgs for apkg=openvpn:
pkg_hash_fetch_best_installation_candidate: openvpn 2.1.3 ar71xx
pkg_hash_fetch_best_installation_candidate: openvpn 2.1.4 ar71xx
pkg_arch_supported: Arch ar71xx (priority 10) supported for pkg openvpn.
Installing openvpn (2.1.4-3) to root...
Downloading http://ecco.selfip.net/backfire/package … r71xx.ipk.
pkg_hash_fetch_best_installation_candidate: Best installation candidate for kmod-tun:
pkg_hash_fetch_best_installation_candidate: apkg=kmod-tun nprovides=3.
pkg_hash_fetch_best_installation_candidate: Adding kmod-tun to providers.
pkg_hash_fetch_best_installation_candidate: Adding kmod-tun to providers.
pkg_hash_fetch_best_installation_candidate: Adding kmod-tun to providers.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.27.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.25.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.27.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.25.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.27.
pkg_hash_fetch_best_installation_candidate: kmod-tun arch=ar71xx arch_priority=10 version=2.6.32.25.
pkg_hash_fetch_best_installation_candidate: Candidate: kmod-tun 2.6.32.27.
Multiple packages (kmod-tun and kmod-tun) providing same name marked HOLD or PREFER. Using latest.
pkg_hash_fetch_best_installation_candidate: 2 matching pkgs for apkg=kmod-tun:
pkg_hash_fetch_best_installation_candidate: kmod-tun 2.6.32.25 ar71xx
pkg_hash_fetch_best_installation_candidate: kmod-tun 2.6.32.27 ar71xx
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x445e30
pkg_hash_fetch_best_installation_candidate: Best installation candidate for libopenssl:
pkg_hash_fetch_best_installation_candidate: apkg=libopenssl nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding libopenssl to providers.
pkg_hash_fetch_best_installation_candidate: Adding libopenssl to providers.
pkg_hash_fetch_best_installation_candidate: libopenssl arch=ar71xx arch_priority=10 version=0.9.8p.
pkg_hash_fetch_best_installation_candidate: libopenssl arch=ar71xx arch_priority=10 version=0.9.8p.
pkg_hash_fetch_best_installation_candidate: Using latest matching libopenssl 0.9.8p ar71xx.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=(nil)
pkg_hash_fetch_best_installation_candidate: Best installation candidate for libopenssl:
pkg_hash_fetch_best_installation_candidate: apkg=libopenssl nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding libopenssl to providers.
pkg_hash_fetch_best_installation_candidate: Adding libopenssl to providers.
pkg_hash_fetch_best_installation_candidate: libopenssl arch=ar71xx arch_priority=10 version=0.9.8p.
pkg_hash_fetch_best_installation_candidate: libopenssl arch=ar71xx arch_priority=10 version=0.9.8p.
pkg_hash_fetch_best_installation_candidate: Candidate: libopenssl 0.9.8p.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x560d38
pkg_hash_fetch_best_installation_candidate: Best installation candidate for zlib:
pkg_hash_fetch_best_installation_candidate: apkg=zlib nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding zlib to providers.
pkg_hash_fetch_best_installation_candidate: Adding zlib to providers.
pkg_hash_fetch_best_installation_candidate: zlib arch=ar71xx arch_priority=10 version=1.2.3.
pkg_hash_fetch_best_installation_candidate: zlib arch=ar71xx arch_priority=10 version=1.2.3.
pkg_hash_fetch_best_installation_candidate: Using latest matching zlib 1.2.3 ar71xx.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=(nil)
pkg_hash_fetch_best_installation_candidate: Best installation candidate for zlib:
pkg_hash_fetch_best_installation_candidate: apkg=zlib nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding zlib to providers.
pkg_hash_fetch_best_installation_candidate: Adding zlib to providers.
pkg_hash_fetch_best_installation_candidate: zlib arch=ar71xx arch_priority=10 version=1.2.3.
pkg_hash_fetch_best_installation_candidate: zlib arch=ar71xx arch_priority=10 version=1.2.3.
pkg_hash_fetch_best_installation_candidate: Candidate: zlib 1.2.3.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x62af38
pkg_hash_fetch_best_installation_candidate: Best installation candidate for liblzo:
pkg_hash_fetch_best_installation_candidate: apkg=liblzo nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding liblzo to providers.
pkg_hash_fetch_best_installation_candidate: Adding liblzo to providers.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.04.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.03.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.04.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.03.
pkg_hash_fetch_best_installation_candidate: 2 matching pkgs for apkg=liblzo:
pkg_hash_fetch_best_installation_candidate: liblzo 2.03 ar71xx
pkg_hash_fetch_best_installation_candidate: liblzo 2.04 ar71xx
pkg_hash_fetch_best_installation_candidate: No matching pkg out of 2 matching_apkgs.
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=(nil)
pkg_hash_fetch_best_installation_candidate: Best installation candidate for liblzo:
pkg_hash_fetch_best_installation_candidate: apkg=liblzo nprovides=2.
pkg_hash_fetch_best_installation_candidate: Adding liblzo to providers.
pkg_hash_fetch_best_installation_candidate: Adding liblzo to providers.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.04.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.03.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.04.
pkg_hash_fetch_best_installation_candidate: liblzo arch=ar71xx arch_priority=10 version=2.03.
pkg_hash_fetch_best_installation_candidate: Candidate: liblzo 2.03.
pkg_hash_fetch_best_installation_candidate: Candidate: liblzo 2.04.
pkg_hash_fetch_best_installation_candidate: 2 matching pkgs for apkg=liblzo:
pkg_hash_fetch_best_installation_candidate: liblzo 2.03 ar71xx
pkg_hash_fetch_best_installation_candidate: liblzo 2.04 ar71xx
pkg_hash_fetch_unsatisfied_dependencies: satisfying_pkg=0x468a78
pkg_arch_supported: Arch ar71xx (priority 10) supported for pkg libopenssl.
Installing libopenssl (0.9.8p-1) to root...
Downloading http://downloads.openwrt.org/backfire/1 … r71xx.ipk.
pkg_run_script: Running script /tmp/opkg-qPcDXt/libopenssl-8MuU7c/preinst.
opkg_install_pkg: Installing maintainer scripts.
opkg_install_pkg: Installing data files for libopenssl.
install_data_files: Extracting data files to /.

... i wisi, nawet reboot z innej sesji nie pomaga.
Co jest przyczyną?

4

Odp: MR3420 openvpn client

Ja dla mnie to coś złego się dzieje w tym systemie. Firstboota zrób.

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

5

Odp: MR3420 openvpn client

Po restarcie i formatowaniu 2GB uSD w E173:

root@Gargoyle:~$ opkg install openvpn
Installing openvpn (2.1.4-3) to root...
Downloading http://ecco.selfip.net/backfire/package … r71xx.ipk.
Multiple packages (kmod-tun and kmod-tun) providing same name marked HOLD or PREFER. Using latest.
Installing libopenssl (0.9.8p-1) to root...
Downloading http://downloads.openwrt.org/backfire/1 … r71xx.ipk.
Collected errors:
* wfopen: //usr/lib/opkg/info/libopenssl.control: Input/output error.
* wfopen: /usr/lib/libssl.so.0.9.8: Input/output error.
* wfopen: /usr/lib/libcrypto.so.0.9.8: Input/output error.
* set_flags_from_control: Failed to open No such file or directory: //usr/lib/opkg/info/libopenssl.control.
* pkg_write_filelist: Failed to open //usr/lib/opkg/info/libopenssl.list: Input/output error.
* opkg_install_pkg: Failed to extract data files for libopenssl. Package debris may remain!
* opkg_install_cmd: Cannot install package openvpn.
* opkg_conf_write_status_files: Couldn't close //usr/lib/opkg/status: Input/output error.

root@Gargoyle:~$ logread
Jan  1 01:04:03 Gargoyle user.crit kernel: EXT2-fs error (device sda1): read_block_bitmap: Cannot read block bitmap - block_group = 7, block_bitmap = 229495
......
Jan  1 01:04:04 Gargoyle user.crit kernel: EXT2-fs error (device sda1): read_block_bitmap: Cannot read block bitmap - block_group = 7, block_bitmap = 229495

Jeszcze raz formatować? Nowa karta...

6

Odp: MR3420 openvpn client

System plików Ci się sypie?

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

7

Odp: MR3420 openvpn client

No właśnie nie wiem, co się sypie. Zrobiłem ponownie wszystko wg howto Extroot dla G.
Po restarcie uSD jest ładnie zamontowana, ale już po uruchomieniu są błedy:

Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=16052, block=65539
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_lookup: ERR from storage dentry, lookup failed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_delete: negative dentry passed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_release: no private data.
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=16052, block=65539
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_lookup: ERR from storage dentry, lookup failed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_delete: negative dentry passed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_release: no private data.
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=16052, block=65539
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_lookup: ERR from storage dentry, lookup failed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_delete: negative dentry passed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_release: no private data.
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=16052, block=65539
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_lookup: ERR from storage dentry, lookup failed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_delete: negative dentry passed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_release: no private data.
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=88213, block=360452
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_lookup: ERR from storage dentry, lookup failed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_delete: negative dentry passed.
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo_d_release: no private data.
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): ext2_get_inode: unable to read inode block - inode=88198, block=360451
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): read_block_bitmap: Cannot read block bitmap - block_group = 11, block_bitmap = 360448
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): read_inode_bitmap: Cannot read inode bitmap - block_group = 11, inode_bitmap = 360449
Jan  1 01:33:25 Gargoyle user.crit kernel: EXT2-fs error (device sda1): read_inode_bitmap: Cannot read inode bitmap - block_group = 11, inode_bitmap = 360449
Jan  1 01:33:25 Gargoyle user.crit kernel: mini_fo: create_sto_file: ERROR creating sto file.
Jan  1 01:33:33 Gargoyle user.warn kernel: ipt_bandwidth: timezone shift detected, adjusting

Jak się tego pozbyć? Jakaś niekompatybilność?

8

Odp: MR3420 openvpn client

Być może masz to na co dziś trafiłem.

Modem (konkretnie to był E173 z iplusa) udostępniał kartę uSD. System to widział, można było zrobić extroota. Ale w trakcie przełączenia modemu karta znikała i pojawiała się jeszcze raz. extroot w takim przypadku dostawał głupawki co odbiło się identycznymi komunikatami w logach.

Rozwiązanie - karta w zewnętrznym czytniku.

Nie sprawdzałem tego, ale być może po prostu wystarczy przełączyć modem na stałe i nie uruchamiać usb_modeswitch, wtedy karta nie zniknie. Ale to trzeba sprawdzić.

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

9

Odp: MR3420 openvpn client

Podłączyłem modem i pendrive przez hub'a do routera - efekt dokładnie taki sam jak poprzednio.
Jeśli szkodzi mu 'pojawiam się i znikam', to by wiele wyjaśniało, bo jak uruchamiam router po extroot'cie to żeby połączył się modem robię mu off/on na porcie USB:
echo 0 > /sys/devices/virtual/gpio/gpio6/value, potem echo 1 > /sys/devices/virtual/gpio/gpio6/value.
Jak zrobić autoconnect po restarcie bez tego zabiegu z usb, może to jest źródłem wszelkich nieszczęść?

10

Odp: MR3420 openvpn client

Przecież nie możesz tego robić! To tak jak byś w działającym windowsie odlączył dysk i podłączył jeszcze raz...

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

11

Odp: MR3420 openvpn client

oki, dotarło.
Jak uzyskać połączenie automatycznie po restarcie routera?

Urządzenie będzie daleko ode mnie i założenie jest takie, że jak nastąpi restart routera z dowolnego powody albo zerwanie łącza np chwilowy brak prądu, to połączenie zostanie wznowione, co więcej połączy się po openvpn.
Chciałem puścić crona, który sprawdzałby co 30min czy jest ping do serwera vpn, jak nie ma to robi restart albo routera albo samego modemu.
off/on usb wydał mi się idealny, ale to było wtedy jak jeszcze nie myślałem o extroot, potem byłem już tak zafiksowany tym podejściem, że nie przewidziałem wszystkich konsekwencji takiego działania.

12

Odp: MR3420 openvpn client

Takie coś jest zrobione w moim sofcie. Co 3min jest ping na 8.8.8.8. Jak nie odpowie - ifup wan jest robiony, jeżeli oczywiście wan to 3g.

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

13

Odp: MR3420 openvpn client

A jak jest od na "Jak uzyskać połączenie automatycznie po restarcie routera"? Po restarcie nie łączy się automatycznie do sieci.

14

Odp: MR3420 openvpn client

W /etc/rc.local wystarczy wpisać /usr/bin/usb_modeswitch -c "/etc/usb_modeswitch.d/12d1:1446"
Działa po hub'ie usb.