Добрый день!
Просьба помочь разобраться с проблемой настройки VPN на CentOS 6.4, конфигурационные файлы и логи приложил.Server
local 88.198.xx.xx
port 1194
tls-server
proto tcp-server
dev tun
ca keys/ca.crt
cert keys/server.crt
key keys/server.key # This file should be kept secret
dh keys/dh2048.pem
server 10.8.0.0 255.255.255.0
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
tls-auth keys/tls.key 0 # This file is secret
comp-lzo
max-clients 15
user root
group root
persist-key
persist-tun
status openvpn-status.log
log-append openvpn.log
verb 6
mute 20
Client
client
remote 88.198.xx.xx 1194
proto tcp
dev tun
ca ca.crt
dh dh2048.pem
remote-cert-tls server
cert client01.crt
key client01.key
tls-client
tls-auth tls.key 1
cipher AES-256-CBC
verb 6
mute 20
keepalive 10 120
comp-lzo
persist-key
persist-tun
resolv-retry infinite
nobind
Server log при старте
Sun Jun 28 12:42:39 2015 us=692126 Current Parameter Settings:
Sun Jun 28 12:42:39 2015 us=692247 config = 'server.conf'
Sun Jun 28 12:42:39 2015 us=692378 mode = 1
Sun Jun 28 12:42:39 2015 us=692406 persist_config = DISABLED
Sun Jun 28 12:42:39 2015 us=692432 persist_mode = 1
Sun Jun 28 12:42:39 2015 us=692456 show_ciphers = DISABLED
Sun Jun 28 12:42:39 2015 us=692481 show_digests = DISABLED
Sun Jun 28 12:42:39 2015 us=692505 show_engines = DISABLED
Sun Jun 28 12:42:39 2015 us=692529 genkey = DISABLED
Sun Jun 28 12:42:39 2015 us=692554 key_pass_file = '[UNDEF]'
Sun Jun 28 12:42:39 2015 us=692578 show_tls_ciphers = DISABLED
Sun Jun 28 12:42:39 2015 us=692602 Connection profiles [default]:
Sun Jun 28 12:42:39 2015 us=692627 proto = tcp-server
Sun Jun 28 12:42:39 2015 us=692657 local = '88.198.xx.xx'
Sun Jun 28 12:42:39 2015 us=692695 local_port = 1194
Sun Jun 28 12:42:39 2015 us=692720 remote = '[UNDEF]'
Sun Jun 28 12:42:39 2015 us=692749 remote_port = 1194
Sun Jun 28 12:42:39 2015 us=692781 remote_float = DISABLED
Sun Jun 28 12:42:39 2015 us=692886 bind_defined = DISABLED
Sun Jun 28 12:42:39 2015 us=693203 bind_local = ENABLED
Sun Jun 28 12:42:39 2015 us=693235 NOTE: --mute triggered...
Sun Jun 28 12:42:39 2015 us=693338 262 variation(s) on previous 20 message(s) suppressed by --mute
Sun Jun 28 12:42:39 2015 us=693384 OpenVPN 2.3.7 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [MH] [IPv6] built on Jun 9 2015
Sun Jun 28 12:42:39 2015 us=693417 library versions: OpenSSL 1.0.1e-fips 11 Feb 2013, LZO 2.03
Sun Jun 28 12:42:39 2015 us=708931 Diffie-Hellman initialized with 2048 bit key
Sun Jun 28 12:42:39 2015 us=709510 Control Channel Authentication: using 'keys/tls.key' as a OpenVPN static key file
Sun Jun 28 12:42:39 2015 us=709595 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Jun 28 12:42:39 2015 us=709628 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Jun 28 12:42:39 2015 us=709685 TLS-Auth MTU parms [ L:1560 D:168 EF:68 EB:0 ET:0 EL:3 ]
Sun Jun 28 12:42:39 2015 us=709875 Socket Buffers: R=[87380->131072] S=[16384->131072]
Sun Jun 28 12:42:39 2015 us=710442 ROUTE_GATEWAY 88.198.xx.xx/255.255.255.240 IFACE=eth0 HWADDR=00:16:3c:61:92:9b
Sun Jun 28 12:42:39 2015 us=713308 TUN/TAP device tun0 opened
Sun Jun 28 12:42:39 2015 us=713457 TUN/TAP TX queue length set to 100
Sun Jun 28 12:42:39 2015 us=713497 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Sun Jun 28 12:42:39 2015 us=713576 /sbin/ip link set dev tun0 up mtu 1500
Sun Jun 28 12:42:39 2015 us=717076 /sbin/ip addr add dev tun0 local 10.8.0.1 peer 10.8.0.2
Sun Jun 28 12:42:39 2015 us=720181 /sbin/ip route add 10.8.0.0/24 via 10.8.0.2
Sun Jun 28 12:42:39 2015 us=721652 Data Channel MTU parms [ L:1560 D:1450 EF:60 EB:143 ET:0 EL:3 AF:3/1 ]
Sun Jun 28 12:42:39 2015 us=722751 GID set to root
Sun Jun 28 12:42:39 2015 us=722826 UID set to root
Sun Jun 28 12:42:39 2015 us=722924 Listening for incoming TCP connection on [AF_INET]88.198.xx.xx:1194
Sun Jun 28 12:42:39 2015 us=722964 TCPv4_SERVER link local (bound): [AF_INET]88.198.xx.xx:1194
Sun Jun 28 12:42:39 2015 us=722985 TCPv4_SERVER link remote: [undef]
Sun Jun 28 12:42:39 2015 us=723047 MULTI: multi_init called, r=256 v=256
Sun Jun 28 12:42:39 2015 us=723091 IFCONFIG POOL: base=10.8.0.4 size=62, ipv6=0
Sun Jun 28 12:42:39 2015 us=723130 MULTI: TCP INIT maxclients=15 maxevents=19
Sun Jun 28 12:42:39 2015 us=723167 Initialization Sequence Completed
Client log (Win7 64)
Sun Jun 28 12:16:32 2015 Warning: cannot open --log file: C:\Program Files\OpenVPN\log\client01.log: Îòêàçàíî â äîñòóïå. (errno=5)
Sun Jun 28 12:16:32 2015 Current Parameter Settings:
Sun Jun 28 12:16:32 2015 config = 'client01.ovpn'
Sun Jun 28 12:16:32 2015 mode = 0
Sun Jun 28 12:16:32 2015 show_ciphers = DISABLED
Sun Jun 28 12:16:32 2015 show_digests = DISABLED
Sun Jun 28 12:16:32 2015 show_engines = DISABLED
Sun Jun 28 12:16:32 2015 genkey = DISABLED
Sun Jun 28 12:16:32 2015 key_pass_file = '[UNDEF]'
Sun Jun 28 12:16:32 2015 show_tls_ciphers = DISABLED
Sun Jun 28 12:16:32 2015 Connection profiles [default]:
Sun Jun 28 12:16:32 2015 proto = tcp-client
Sun Jun 28 12:16:32 2015 local = '[UNDEF]'
Sun Jun 28 12:16:32 2015 local_port = 0
Sun Jun 28 12:16:32 2015 remote = '88.198.xx.xx'
Sun Jun 28 12:16:32 2015 remote_port = 1194
Sun Jun 28 12:16:32 2015 remote_float = DISABLED
Sun Jun 28 12:16:32 2015 bind_defined = DISABLED
Sun Jun 28 12:16:32 2015 bind_local = DISABLED
Sun Jun 28 12:16:32 2015 connect_retry_seconds = 5
Sun Jun 28 12:16:32 2015 connect_timeout = 10
Sun Jun 28 12:16:32 2015 NOTE: --mute triggered...
Sun Jun 28 12:16:32 2015 265 variation(s) on previous 20 message(s) suppressed by --mute
Sun Jun 28 12:16:32 2015 OpenVPN 2.3.7 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [PKCS11] [IPv6] built on Jun 8 2015
Sun Jun 28 12:16:32 2015 library versions: OpenSSL 1.0.1m 19 Mar 2015, LZO 2.08
Sun Jun 28 12:16:32 2015 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25341
Sun Jun 28 12:16:32 2015 Need hold release from management interface, waiting...
Sun Jun 28 12:16:32 2015 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25341
Sun Jun 28 12:16:33 2015 MANAGEMENT: CMD 'state on'
Sun Jun 28 12:16:33 2015 MANAGEMENT: CMD 'log all on'
Sun Jun 28 12:16:33 2015 MANAGEMENT: CMD 'hold off'
Sun Jun 28 12:16:33 2015 MANAGEMENT: CMD 'hold release'
Sun Jun 28 12:16:33 2015 Control Channel Authentication: using 'tls.key' as a OpenVPN static key file
Sun Jun 28 12:16:33 2015 Outgoing Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Jun 28 12:16:33 2015 Incoming Control Channel Authentication: Using 160 bit message hash 'SHA1' for HMAC authentication
Sun Jun 28 12:16:33 2015 LZO compression initialized
Sun Jun 28 12:16:33 2015 Control Channel MTU parms [ L:1560 D:168 EF:68 EB:0 ET:0 EL:3 ]
Sun Jun 28 12:16:33 2015 Socket Buffers: R=[8192->8192] S=[8192->8192]
Sun Jun 28 12:16:33 2015 Data Channel MTU parms [ L:1560 D:1450 EF:60 EB:143 ET:0 EL:3 AF:3/1 ]
Sun Jun 28 12:16:33 2015 Local Options String: 'V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client'
Sun Jun 28 12:16:33 2015 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_SERVER,comp-lzo,keydir 0,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-server'
Sun Jun 28 12:16:33 2015 Local Options hash (VER=V4): '2f2c6498'
Sun Jun 28 12:16:33 2015 Expected Remote Options hash (VER=V4): '9915e4a2'
Sun Jun 28 12:16:33 2015 Attempting to establish TCP connection with [AF_INET]88.198.159.87:1194 [nonblock]
Sun Jun 28 12:16:33 2015 MANAGEMENT: >STATE:1435482993,TCP_CONNECT,,,
Sun Jun 28 12:16:43 2015 TCP: connect to [AF_INET]88.198.xx.xx:1194 failed, will try again in 5 seconds: Попытка объединить диск с папкой на объединенном диске.
В журнале сервера при попытке подключения через OVPN клиент тишина, а если telnetom стукнуться на порт 1194, то:
Sun Jun 28 11:59:59 2015 us=293782 MULTI: multi_create_instance called
Sun Jun 28 11:59:59 2015 us=293867 Re-using SSL/TLS context
Sun Jun 28 11:59:59 2015 us=293903 LZO compression initialized
Sun Jun 28 11:59:59 2015 us=293981 Control Channel MTU parms [ L:1560 D:168 EF:68 EB:0 ET:0 EL:3 ]
Sun Jun 28 11:59:59 2015 us=294008 Data Channel MTU parms [ L:1560 D:1450 EF:60 EB:143 ET:0 EL:3 AF:3/1 ]
Sun Jun 28 11:59:59 2015 us=294293 Local Options String: 'V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_SERVER,comp-lzo,keydir 0,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-server'
Sun Jun 28 11:59:59 2015 us=294334 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1560,tun-mtu 1500,proto TCPv4_CLIENT,comp-lzo,keydir 1,cipher AES-256-CBC,auth SHA1,keysize 256,tls-auth,key-method 2,tls-client'
Sun Jun 28 11:59:59 2015 us=294361 Local Options hash (VER=V4): '9915e4a2'
Sun Jun 28 11:59:59 2015 us=294420 Expected Remote Options hash (VER=V4): '2f2c6498'
Sun Jun 28 11:59:59 2015 us=294576 TCP connection established with [AF_INET]91.77.215.4:28063
Sun Jun 28 11:59:59 2015 us=294599 TCPv4_SERVER link local: [undef]
Sun Jun 28 11:59:59 2015 us=294647 TCPv4_SERVER link remote: [AF_INET]91.77.215.4:28063
Sun Jun 28 12:00:59 2015 us=608965 91.77.215.4:28063 TLS Error: TLS key negotiation failed to occur within 60 seconds (check your network connectivity)
Sun Jun 28 12:00:59 2015 us=609043 91.77.215.4:28063 TLS Error: TLS handshake failed
Sun Jun 28 12:00:59 2015 us=609115 91.77.215.4:28063 Fatal TLS error (check_tls_errors_co), restarting
Sun Jun 28 12:00:59 2015 us=609136 91.77.215.4:28063 SIGUSR1[soft,tls-error] received, client-instance restarting
Sun Jun 28 12:00:59 2015 us=609168 TCP/UDP: Closing socket
[root@intvpn ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:16:3C:61:92:9B
inet addr:88.198.xx.xx Bcast:88.198.xx.xx Mask:255.255.255.240
inet6 addr: fe83::226:3cff:fe51:929b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:186038 errors:0 dropped:0 overruns:0 frame:0
TX packets:57390 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:12001451 (11.4 MiB) TX bytes:6699933 (6.3 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
tun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
inet addr:10.8.0.1 P-t-P:10.8.0.2 Mask:255.255.255.255
UP POINTOPOINT RUNNING NOARP MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:100
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[root@intvpn ~]# route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.8.0.2 * 255.255.255.255 UH 0 0 0 tun0
88.198.xx.xx * 255.255.255.240 U 0 0 0 eth0
10.8.0.0 10.8.0.2 255.255.255.0 UG 0 0 0 tun0
link-local * 255.255.0.0 U 1002 0 0 eth0
default 88-198-xx-xx. 0.0.0.0 UG 0 0 0 eth0
Пробовал подключаться как с этими правилами в iptables, так и с остановленной службой, результат идентичный.
iptables -A INPUT -p tcp --dport 1194 -j ACCEPT
iptables -A FORWARD -i tun0 -o eth0 -j ACCEPT
iptables -t nat -A POSTROUTING -o eth0 -j SNAT --to-soure 88.198.xx.xx
На tun0 tcpdump ничего не показывает.
[root@intvpn ~]# tcpdump -nv -i tun0
tcpdump: listening on tun0, link-type RAW (Raw IP), capture size 65535 bytes