Temat: Konfiguracja OpenVPN
Witam i proszę o pomoc przy konfiguracji OpenVPN. Klient nie może się połączyć z serwerem choć ten wydaje się sprawnie działać. oto opis konfiguracji jakiej dokonalem
Lokalizacja 1.
Router F@ast2704(openWRT -trunk) jako serwer, dostępny publiczny stały adres IP
adresacja routera192.168.1.1
- serwer OpenVPN postawiłem wg. http://eko.one.pl/?p=openwrt-openvpn
Aby sprawdzi działanie serwera użyłem Telefonu z Androidem. Uzyskuje połączenie z serwerem ale nie otrzymuje IP
Ponowny test wykonałem z użyciem komputera z z system windows 7 uzyskuje polaczenie, adres IP jest przydzielany z zakresu 192.168.1.XXX wszystko działa prawidłowo
Lokalizacja 2.
DIR-300(openWRT od Cezarego) z zainstalowanym jedynie OpenVPN
adresacja 192.168.0.1
konfiguracja klienta openVPN jakiej dokonałem krok po kroku
- ustalenie aktualnej daty i godziny
- skopiowanie secret.key do /etc/openvpn/
- stworzenie pliku /etc/openvpn/config.ovpn
dev tap
proto udp
remote 217.197.YYY.XXX 1194
resolv-retry infinite
nobind
mute-replay-warnings
secret /etc/openvpn/secret.key
status /tmp/status.log
verb 3
float
- dodanie interfejsu vpn do /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'config interface 'lan'
option ifname 'eth0.1'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.0.1'
option netmask '255.255.255.0'
option macaddr 'f0:7d:68:47:0e:3c'config interface 'wan'
option ifname 'wlan0'
option proto 'dhcp'config interface 'vpn'
option proto 'none'
option ifname 'tap0'config switch
option name 'rt305x'
option reset '1'
option enable_vlan '1'config switch_vlan
option device 'rt305x'
option vlan '1'
option ports '0 1 2 3 4 6t'
- dodanie reguł do firewalla /etc/config/firewall
config rule
option target ACCEPT
option dest_port 1194
option src wan
option proto udp
option family ipv4config zone
option name vpn
option input ACCEPT
option forward REJECT
option output ACCEPT
option network vpn
-uruchomienie tunelu poleceniem
openvpn --config /etc/openvpn/config.ovpn
Tue Apr 22 21:28:28 2014 OpenVPN 2.2.2 mipsel-openwrt-linux [SSL] [LZO2] [EPOLL] built on Mar 15 2013
Tue Apr 22 21:28:28 2014 NOTE: OpenVPN 2.1 requires '--script-security 2' or higher to call user-defined scripts or executables
Tue Apr 22 21:28:28 2014 WARNING: file '/etc/openvpn/secret.key' is group or others accessible
Tue Apr 22 21:28:28 2014 Static Encrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Apr 22 21:28:28 2014 Static Encrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Apr 22 21:28:28 2014 Static Decrypt: Cipher 'BF-CBC' initialized with 128 bit key
Tue Apr 22 21:28:28 2014 Static Decrypt: Using 160 bit message hash 'SHA1' for HMAC authentication
Tue Apr 22 21:28:28 2014 Socket Buffers: R=[163840->131072] S=[163840->131072]
Tue Apr 22 21:28:28 2014 TUN/TAP device tap0 opened
Tue Apr 22 21:28:28 2014 TUN/TAP TX queue length set to 100
Tue Apr 22 21:28:28 2014 Data Channel MTU parms [ L:1576 D:1450 EF:44 EB:4 ET:32 EL:0 ]
Tue Apr 22 21:28:28 2014 UDPv4 link local: [undef]
Tue Apr 22 21:28:28 2014 UDPv4 link remote: 217.197.74.XXX:1194
^CTue Apr 22 21:28:45 2014 event_wait : Interrupted system call (code=4)
Tue Apr 22 21:28:45 2014 TCP/UDP: Closing socket
Tue Apr 22 21:28:45 2014 Closing TUN/TAP interface
Tue Apr 22 21:28:45 2014 SIGINT[hard,] received, process exiting
log systemowy
Apr 22 21:20:29 OpenWrt authpriv.notice dropbear[975]: Password auth succeeded for 'root' from 192.168.0.200:49251
Apr 22 21:28:28 OpenWrt daemon.notice netifd: Interface 'vpn' is now up
Apr 22 21:28:28 OpenWrt user.notice firewall: Reloading firewall due to ifup of vpn (tap0)
Apr 22 21:28:45 OpenWrt daemon.notice netifd: Interface 'vpn' is now down
root@OpenWrt:~# Apr 22 21:20:29 OpenWrt authpriv.notice dropbear[975]: Password auth succeeded for 'root' from 192.168.0.200:49251
statystyki open vpn:
OpenVPN STATISTICS
Updated,Tue Apr 22 21:28:28 2014
TUN/TAP read bytes,0
TUN/TAP write bytes,0
TCP/UDP read bytes,0
TCP/UDP write bytes,0
Auth read bytes,0
END