Post by elmer radi radissonbtw, odnosnie lopatologii, tu masz calkiem pomocny przyklad jak to sie
robi na openwrt, a kluczowe elementy konfigu sa akurat uniwersalne
http://rpc.one.pl/index.php/lista-artykulow/34-openwrt/105-laczenie-dwoch-podsieci-za-pomoca-openvpn-w-openwrt
wyglądało obiecująco ale nadal coś robię źle
w tej chwili mam taką konfigurację:
#################################################
#
# ServerA.ovpn
#
#################################################
local 192.168.2.100
port 1194
proto tcp
dev tun
ca ca.crt
cert vpn_server_xxxxxx.dyndns.org.crt
key vpn_server_techsam.xxxxxx.org.key # This file should be kept secret
dh dh4096.pem
;topology subnet
server 10.4.0.0 255.255.255.0
;ifconfig-pool-persist ipp.txt
push "route 192.168.2.0 255.255.255.0"
push "route 192.168.1.0 255.255.255.0"
client-config-dir ccd
route 192.168.1.128 255.255.255.0
;client-to-client
keepalive 10 120
cipher AES-256-CBC
comp-lzo
;max-clients 100
persist-key
persist-tun
status openvpn-status.log
verb 3
############################################
log z serverA
###########################################
Fri Dec 08 19:40:34 2017 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Fri Dec 08 19:40:34 2017 Windows version 6.2 (Windows 8 or greater) 64bit
Fri Dec 08 19:40:34 2017 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.10
Fri Dec 08 19:40:34 2017 Diffie-Hellman initialized with 4096 bit key
Fri Dec 08 19:40:34 2017 interactive service msg_channel=0
Fri Dec 08 19:40:34 2017 ROUTE_GATEWAY 192.168.2.1/255.255.255.0 I=5 HWADDR=08:2e:5f:31:db:95
Fri Dec 08 19:40:34 2017 open_tun
Fri Dec 08 19:40:34 2017 TAP-WIN32 device [Ethernet 2] opened: \\.\Global\{A5E4EFEB-8712-4C5F-8098-438947698A48}.tap
Fri Dec 08 19:40:34 2017 TAP-Windows Driver Version 9.21
Fri Dec 08 19:40:34 2017 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.4.0.1/255.255.255.252 on interface {A5E4EFEB-8712-4C5F-8098-438947698A48} [DHCP-serv: 10.4.0.2, lease-time: 31536000]
Fri Dec 08 19:40:34 2017 Sleeping for 10 seconds...
Fri Dec 08 19:40:44 2017 Successful ARP Flush on interface [9] {A5E4EFEB-8712-4C5F-8098-438947698A48}
Fri Dec 08 19:40:44 2017 do_ifconfig, tt->did_ifconfig_ipv6_setup=0
Fri Dec 08 19:40:44 2017 C:\Windows\system32\route.exe ADD 192.168.1.128 MASK 255.255.255.0 10.4.0.2
Fri Dec 08 19:40:44 2017 Warning: address 192.168.1.128 is not a network address in relation to netmask 255.255.255.0
Fri Dec 08 19:40:44 2017 ROUTE: route addition failed using CreateIpForwardEntry: Parametr jest niepoprawny. [status=87 if_index=9]
Fri Dec 08 19:40:44 2017 Route addition via IPAPI failed [adaptive]
Fri Dec 08 19:40:44 2017 Route addition fallback to route.exe
Fri Dec 08 19:40:44 2017 env_block: add PATH=C:\Windows\System32;C:\Windows;C:\Windows\System32\Wbem
Fri Dec 08 19:40:44 2017 C:\Windows\system32\route.exe ADD 10.4.0.0 MASK 255.255.255.0 10.4.0.2
Fri Dec 08 19:40:44 2017 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=35 and dwForwardType=4
Fri Dec 08 19:40:44 2017 Route addition via IPAPI succeeded [adaptive]
Fri Dec 08 19:40:44 2017 Could not determine IPv4/IPv6 protocol. Using AF_INET
Fri Dec 08 19:40:44 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Dec 08 19:40:44 2017 Listening for incoming TCP connection on [AF_INET]192.168.2.100:1194
Fri Dec 08 19:40:44 2017 TCPv4_SERVER link local (bound): [AF_INET]192.168.2.100:1194
Fri Dec 08 19:40:44 2017 TCPv4_SERVER link remote: [AF_UNSPEC]
Fri Dec 08 19:40:44 2017 MULTI: multi_init called, r=256 v=256
Fri Dec 08 19:40:44 2017 IFCONFIG POOL: base=10.4.0.4 size=62, ipv6=0
Fri Dec 08 19:40:44 2017 MULTI: TCP INIT maxclients=60 maxevents=64
Fri Dec 08 19:40:44 2017 Initialization Sequence Completed
#####################################
ccd client config
####################################
ifconfig-push 10.4.0.5 10.4.0.6
iroute 192.168.1.0 255.255.255.0
iroute 192.168.2.0 255.255.255.0
##################################
ccd client log
##############################
Options error: option 'ifconfig-push' cannot be used in this context (C:\Program Files\OpenVPN\config\ccd\vpn_client_xxxxx.dyndns.org.ovpn)
Use --help for more information.
##############################################
# #
# ServerB config #
# #
##############################################
client
dev tun
proto tcp
remote xxxxx.dyndns.org 1194
nobind
persist-key
persist-tun
ca ca.crt
cert vpn_client_xxxxxx.dyndns.org.crt
key vpn_client_xxxxxx.dyndns.org.key
remote-cert-tls server
cipher AES-256-CBC
comp-lzo
verb 3
#####################################################
serverB log
####################################################
Fri Dec 08 19:57:43 2017 OpenVPN 2.4.4 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Sep 26 2017
Fri Dec 08 19:57:43 2017 Windows version 6.2 (Windows 8 or greater) 64bit
Fri Dec 08 19:57:43 2017 library versions: OpenSSL 1.0.2l 25 May 2017, LZO 2.10
Fri Dec 08 19:57:43 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]aaa.bbb.ccc.ddd:1194
Fri Dec 08 19:57:43 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Dec 08 19:57:43 2017 Attempting to establish TCP connection with [AF_INET]aaa.bbb.ccc.ddd:1194 [nonblock]
Fri Dec 08 19:59:43 2017 TCP: connect to [AF_INET]aaa.bbb.ccc.ddd:1194 failed: Unknown error
Fri Dec 08 19:59:43 2017 SIGUSR1[connection failed(soft),init_instance] received, process restarting
Fri Dec 08 19:59:43 2017 Restart pause, 5 second(s)
Fri Dec 08 19:59:49 2017 TCP/UDP: Preserving recently used remote address: [AF_INET]aaa.bbb.ccc.ddd:1194
Fri Dec 08 19:59:49 2017 Socket Buffers: R=[65536->65536] S=[65536->65536]
Fri Dec 08 19:59:49 2017 Attempting to establish TCP connection with [AF_INET]aaa.bbb.ccc.ddd:1194 [nonblock]