🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: pl.comp.sieci
Article #57219

Re: OpenVPN jak skonfigurować routing

#57219
From: markpunk
Date: Fri, 08 Dec 2017 19:03
159 lines
7822 bytes
W dniu środa, 6 grudnia 2017 12:10:52 UTC+1 użytkownik elmer radi radisson napisał:
> btw, 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]
Technical Details
Message-ID: <bd51d29e-60e1-4126-af83-3a152b064c51@googlegroups.com>
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g35no1312028qtk.1!news-out.google.com!t48ni1811qtc.1!nntp.google.com!g35no1312027qtk.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
References: <d95d999c-baab-46e3-bbcd-ff92f2c6d54c@googlegroups.com> <5a145e13$0$5155$65785112@news.neostrada.pl> <7601eb8e-e800-448a-b5c9-8dddf14f098d@googlegroups.com> <ov6bau$qnr$1@portraits.wsisiz.edu.pl> <5a4d5ac5-6739-4fd7-838e-f6bf272e3778@googlegroups.com> <p08ijl$fg9$1@portraits.wsisiz.edu.pl> <p08j7s$glc$1@portraits.wsisiz.edu.pl>

Show Full Headers
Complete Article Headers
X-Received: by 10.55.74.8 with SMTP id x8mr22287442qka.22.1512759782633;        Fri, 08 Dec 2017 11:03:02 -0800 (PST)
X-Received: by 10.31.120.9 with SMTP id t9mr1314143vkc.7.1512759782254; Fri, 08 Dec 2017 11:03:02 -0800 (PST)
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.icm.edu.pl!news.nask.pl!news.nask.org.pl!news.unit0.net!peer03.am4!peer.am4.highwinds-media.com!peer03.iad!feed-me.highwinds-media.com!news.highwinds-media.com!g35no1312028qtk.1!news-out.google.com!t48ni1811qtc.1!nntp.google.com!g35no1312027qtk.1!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail
Newsgroups: pl.comp.sieci
Date: Fri, 8 Dec 2017 11:03:01 -0800 (PST)
In-Reply-To: <p08j7s$glc$1@portraits.wsisiz.edu.pl>
Complaints-To: groups-abuse@google.com
Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=87.207.62.176; posting-account=X7Ky1woAAAD8hRHIDu-SyiBI46tOA_3K
NNTP-Posting-Host: 87.207.62.176
References: <d95d999c-baab-46e3-bbcd-ff92f2c6d54c@googlegroups.com> <5a145e13$0$5155$65785112@news.neostrada.pl> <7601eb8e-e800-448a-b5c9-8dddf14f098d@googlegroups.com> <ov6bau$qnr$1@portraits.wsisiz.edu.pl> <5a4d5ac5-6739-4fd7-838e-f6bf272e3778@googlegroups.com> <p08ijl$fg9$1@portraits.wsisiz.edu.pl> <p08j7s$glc$1@portraits.wsisiz.edu.pl>
User-Agent: G2/1.0
MIME-Version: 1.0
Message-ID: <bd51d29e-60e1-4126-af83-3a152b064c51@googlegroups.com>
Subject: Re: OpenVPN jak skonfigurować routing
From: markpunk <markpunk@poczta.fm>
Injection-Date: Fri, 08 Dec 2017 19:03:02 +0000
X-Received-Bytes: 7795
X-Received-Body-CRC: 1577410500
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit