Схема:
LAN1: 192.168.21.0/24
LAN2: 10.77.77.0/24
OpenVPN сервер: eth0:10.77.77.11, tun1:10.10.30.1
OpenVPN клиент: eth0:192.168.21.30, tun1:10.10.30.25
VPN сеть: 10.10.30.0/24
Конфиг сервера:
local 10.77.77.11
port 1194
proto udp
dev tun1
tun-mtu 1500
ca /etc/openvpn/.key/ca.crt
cert /etc/openvpn/.key/server.crt
key /etc/openvpn/.key/server.key
dh /etc/openvpn/.key/dh2048.pem
server 10.10.30.0 255.255.255.0
daemon
mode server
tls-server
ifconfig-pool-persist /etc/openvpn/ip.sv
client-to-client
push "route 10.77.77.0 255.255.255.0"
client-config-dir ccd
keepalive 10 120
tls-auth /etc/openvpn/.tls/ta.key 0
cipher AES-256-CBC
auth SHA512
comp-lzo
max-clients 20
user openvpn
group openvpn
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
log-append /var/log/openvpn/openvpn.log
verb 8
mute 20
Конфиг клиента:
client
tls-client
dev tun1
proto udp
remote 10.77.77.11 1194
route-delay 2
resolv-retry infinite
nobind
persist-key
persist-tun
ca ca.crt
dh dh2048.pem
cert gws_client.crt
key gws_client.key
key-direction 1
tls-auth ta.key
tun-mtu 1500
tun-mtu-extra 32
cipher AES-256-CBC
auth SHA512
comp-lzo
verb 4
mute 20
log-append openvpn_client.log
status status_client.log
Логи клиент при подключении:
Tue Mar 4 21:53:53 2014 us=409683 Current Parameter Settings:
Tue Mar 4 21:53:53 2014 us=409854 config = 'gws_client.ovpn'
Tue Mar 4 21:53:53 2014 us=409893 mode = 0
Tue Mar 4 21:53:53 2014 us=409926 persist_config = DISABLED
Tue Mar 4 21:53:53 2014 us=409973 persist_mode = 1
Tue Mar 4 21:53:53 2014 us=410012 show_ciphers = DISABLED
Tue Mar 4 21:53:53 2014 us=410045 show_digests = DISABLED
Tue Mar 4 21:53:53 2014 us=410077 show_engines = DISABLED
Tue Mar 4 21:53:53 2014 us=410109 genkey = DISABLED
Tue Mar 4 21:53:53 2014 us=410170 key_pass_file = '[UNDEF]'
Tue Mar 4 21:53:53 2014 us=410202 show_tls_ciphers = DISABLED
Tue Mar 4 21:53:53 2014 us=410232 Connection profiles [default]:
Tue Mar 4 21:53:53 2014 us=410261 proto = udp
Tue Mar 4 21:53:53 2014 us=410292 local = '[UNDEF]'
Tue Mar 4 21:53:53 2014 us=410322 local_port = 0
Tue Mar 4 21:53:53 2014 us=410352 remote = '192.168.21.5'
Tue Mar 4 21:53:53 2014 us=410381 remote_port = 1194
Tue Mar 4 21:53:53 2014 us=410411 remote_float = DISABLED
Tue Mar 4 21:53:53 2014 us=410440 bind_defined = DISABLED
Tue Mar 4 21:53:53 2014 us=410471 bind_local = DISABLED
Tue Mar 4 21:53:53 2014 us=410500 NOTE: --mute triggered...
Tue Mar 4 21:53:53 2014 us=410548 255 variation(s) on previous 20 message(s) suppressed by --mute
Tue Mar 4 21:53:53 2014 us=410586 OpenVPN 2.3.2 x86_64-redhat-linux-gnu [SSL (OpenSSL)] [LZO] [EPOLL] [PKCS11] [eurephia] [MH] [IPv6] built on Sep 12 2013
Tue Mar 4 21:53:53 2014 us=410741 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Tue Mar 4 21:53:53 2014 us=412265 WARNING: file 'ta.key' is group or others accessible
Tue Mar 4 21:53:53 2014 us=412319 Control Channel Authentication: using 'ta.key' as a OpenVPN static key file
Tue Mar 4 21:53:53 2014 us=412369 Outgoing Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Tue Mar 4 21:53:53 2014 us=412410 Incoming Control Channel Authentication: Using 512 bit message hash 'SHA512' for HMAC authentication
Tue Mar 4 21:53:53 2014 us=412471 LZO compression initialized
Tue Mar 4 21:53:53 2014 us=412653 Control Channel MTU parms [ L:1634 D:210 EF:110 EB:0 ET:0 EL:0 ]
Tue Mar 4 21:53:53 2014 us=412750 Socket Buffers: R=[124928->131072] S=[124928->131072]
Tue Mar 4 21:53:53 2014 us=412880 Data Channel MTU parms [ L:1634 D:1450 EF:102 EB:135 ET:32 EL:0 AF:3/1 ]
Tue Mar 4 21:53:53 2014 us=412945 Local Options String: 'V4,dev-type tun,link-mtu 1634,tun-mtu 1532,proto UDPv4,comp-lzo,keydir 1,cipher AES-256-CBC,auth SHA512,keysize 256,tls-auth,key-method 2,tls-client'
Tue Mar 4 21:53:53 2014 us=413021 Expected Remote Options String: 'V4,dev-type tun,link-mtu 1634,tun-mtu 1532,proto UDPv4,comp-lzo,keydir 0,cipher AES-256-CBC,auth SHA512,keysize 256,tls-auth,key-method 2,tls-server'
Tue Mar 4 21:53:53 2014 us=413112 Local Options hash (VER=V4): '6a152ec4'
Tue Mar 4 21:53:53 2014 us=413196 Expected Remote Options hash (VER=V4): 'e1f65e10'
Tue Mar 4 21:53:53 2014 us=413263 UDPv4 link local: [undef]
Tue Mar 4 21:53:53 2014 us=413324 UDPv4 link remote: [AF_INET]192.168.21.5:1194
Tue Mar 4 21:53:53 2014 us=416596 TLS: Initial packet from [AF_INET]192.168.21.5:1194, sid=d5f55581 fd4793fb
Tue Mar 4 21:53:53 2014 us=464101 VERIFY OK: depth=1, C=KG, ST=BI, L=Bishkek, O=7777, OU=changeme, CN=gws.7777.kg, name=changeme, emailAddress=it@7777.kg
Tue Mar 4 21:53:53 2014 us=464694 VERIFY OK: depth=0, C=KG, ST=BI, L=Bishkek, O=7777, OU=changeme, CN=server, name=changeme, emailAddress=it@7777.kg
Tue Mar 4 21:53:53 2014 us=563650 WARNING: 'link-mtu' is used inconsistently, local='link-mtu 1634', remote='link-mtu 1602'
Tue Mar 4 21:53:53 2014 us=563728 WARNING: 'tun-mtu' is used inconsistently, local='tun-mtu 1532', remote='tun-mtu 1500'
Tue Mar 4 21:53:53 2014 us=564111 Data Channel Encrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Tue Mar 4 21:53:53 2014 us=564161 Data Channel Encrypt: Using 512 bit message hash 'SHA512' for HMAC authentication
Tue Mar 4 21:53:53 2014 us=564196 Data Channel Decrypt: Cipher 'AES-256-CBC' initialized with 256 bit key
Tue Mar 4 21:53:53 2014 us=564234 Data Channel Decrypt: Using 512 bit message hash 'SHA512' for HMAC authentication
Tue Mar 4 21:53:53 2014 us=564322 Control Channel: TLSv1, cipher TLSv1/SSLv3 DHE-RSA-AES256-SHA, 2048 bit RSA
Tue Mar 4 21:53:53 2014 us=564410 [server] Peer Connection Initiated with [AF_INET]192.168.21.5:1194
Tue Mar 4 21:53:55 2014 us=917096 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
Tue Mar 4 21:53:55 2014 us=919811 PUSH: Received control message: 'PUSH_REPLY,route 10.10.30.0 255.255.255.0,topology net30,ping 10,ping-restart 120,ifconfig 10.10.30.25 10.10.30.26'
Tue Mar 4 21:53:55 2014 us=919911 OPTIONS IMPORT: timers and/or timeouts modified
Tue Mar 4 21:53:55 2014 us=919941 OPTIONS IMPORT: --ifconfig/up options modified
Tue Mar 4 21:53:55 2014 us=919962 OPTIONS IMPORT: route options modified
Tue Mar 4 21:53:55 2014 us=920285 ROUTE_GATEWAY 192.168.21.3/255.255.255.0 IFACE=eth0 HWADDR=f0:bf:97:1b:a1:ee
Tue Mar 4 21:53:55 2014 us=920650 TUN/TAP device tun1 opened
Tue Mar 4 21:53:55 2014 us=920691 TUN/TAP TX queue length set to 100
Tue Mar 4 21:53:55 2014 us=920722 do_ifconfig, tt->ipv6=0, tt->did_ifconfig_ipv6_setup=0
Tue Mar 4 21:53:55 2014 us=920760 /sbin/ip link set dev tun1 up mtu 1500
Tue Mar 4 21:53:55 2014 us=923460 /sbin/ip addr add dev tun1 local 10.10.30.25 peer 10.10.30.26
Tue Mar 4 21:53:58 2014 us=103012 /sbin/ip route add 10.10.30.0/24 via 10.10.30.26
Tue Mar 4 21:53:58 2014 us=104524 Initialization Sequence Completed
Таблица маршрутизации после подключения:
# ip route
10.10.30.26 dev tun1 proto kernel scope link src 10.10.30.25
10.10.25.2 dev tun0 proto kernel scope link src 10.10.25.1
192.168.21.0/24 via 192.168.21.3 dev eth0
10.10.30.0/24 via 10.10.30.26 dev tun1
10.10.25.0/24 via 10.10.25.2 dev tun0
169.254.0.0/16 dev eth0 scope link metric 1002
default via 192.168.21.3 dev eth0
как видно в таблице нет сети 10.77.77.0/24
Добавил маршрут вручную:
# ip route add 10.77.77.0/24 via 10.10.30.26
В итоге получилась следующая таблица маршрутов:
# ip route
10.10.30.26 dev tun1 proto kernel scope link src 10.10.30.25
10.10.25.2 dev tun0 proto kernel scope link src 10.10.25.1
10.77.77.0/24 via 10.10.30.26 dev tun1
192.168.21.0/24 via 192.168.21.3 dev eth0
10.10.30.0/24 via 10.10.30.26 dev tun1
10.10.25.0/24 via 10.10.25.2 dev tun0
169.254.0.0/16 dev eth0 scope link metric 1002
default via 192.168.21.3 dev eth0
При попытке пинга хостов в сети 10.77.77.0/24 пинги не проходят.
Пример:
# ping 10.77.77.11
PING 10.77.77.11 (10.77.77.11) 56(84) bytes of data.
На сервере OpenVPN я не вижу ICMP пакетов:
# tcpdump -i tun1 icmp
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tun1, link-type RAW (Raw IP), capture size 65535 bytes
Так же отключал iptables - безрезультатно.
Подскажите куда еще можно посмотреть чтобы решить проблему.
Спасибо!