i decided to use OpenVPN to realize VPN connections to the company network, since i made positive experiences when i used it on a rasperry pi at home.
the network of the client computer is: 192.168.178.0
the client computer is connected to the internet via a fritzbox router.
the target network of the office is: 192.168.2.0
it is connected to the internet via a telekom router (Digitalisierungsbox Smart) with IP 192.168.2.1
an ordinary computer (Windows 10 Pro 1909) within this network acts as a server
this server has 2 ethernet interfaces - a realtek adapter on the motherboard (static IP 192.168.2.2) and another one is attached via an ASIX AX88179 USB 3.0 to Gigabit Ethernet Adapter.
i created a network-bridge with the usb-ethernet-adapter and the openvpn tap-windows-adapter V9 (previously renamed to tap-bridge) and assigned the static IP 192.168.2.99 to it (outside of the dhcp ip range and checked if ip is available)
udp traffic is forwarded by the telekom router on port 1194 to 192.168.2.2.
(i am also forwarding udp traffic on port 1195 to 192.168.2.99 and tested it with an appropriate port 1194 line in the server and client-config since i am not sure about the correct configuration)
i also configured firewall settings, but disabled firewall and kaspersky antivirus while testing.
i am able to create a tunnel to the OpenVPN server with the OpenVPN client on a Windows 10 Pro machine (green symbol), but i can't ping any remote device from the client. and therefore i cant access the windows shares (a main goal and the reason why i decided to use tap / bridging)
since i am not an networking-expert, i am not sure if i have to configure any additional routes and which routes would be required where.
here is my current configuration:
;local 192.168.2.2
port 1194
proto udp
dev tap
dev-node tap-bridge
ca "C:\\Program Files\\OpenVPN\\server-keys\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\server-keys\\vpn.crt"
key "C:\\Program Files\\OpenVPN\\server-keys\\vpn.key"
dh "C:\\Program Files\\OpenVPN\\server-keys\\dh2048.pem"
;topology subnet
ifconfig-pool-persist "C:\\Program Files\\OpenVPN\\ipp.txt"
server-bridge 192.168.2.99 255.255.255.0 192.168.2.100 192.168.2.119
push "dhcp-option DNS 192.168.2.1"
push "route 192.168.2.0 255.255.255.0"
client-to-client
keepalive 10 120
compress lz4-v2
push "compress lz4-v2"
;compress lz4
max-clients 20
persist-key
persist-tun
verb 3
status "C:\\Program Files\\OpenVPN\\log\\openvpn-status.log"
log "C:\\Program Files\\OpenVPN\\log\\openvpn.log"
log-append "C:\\Program Files\\OpenVPN\\log\\openvpn.log"
explicit-exit-notify 1
client
dev tap
;dev tun
dev-node tap-adapter
proto udp
remote remote-server-host 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca "C:\\Program Files\\OpenVPN\\config\\ca.crt"
cert "C:\\Program Files\\OpenVPN\\config\\client1.crt"
key "C:\\Program Files\\OpenVPN\\config\\client1.key"
compress lz4
verb 3
;mute 20
tap-sleep 3
connection log:
Wed Jun 17 18:11:43 2020 OpenVPN 2.4.9 x86_64-w64-mingw32 [SSL (OpenSSL)] [LZO] [LZ4] [PKCS11] [AEAD] built on Apr 16 2020
Wed Jun 17 18:11:43 2020 Windows version 6.2 (Windows 8 or greater) 64bit
Wed Jun 17 18:11:43 2020 library versions: OpenSSL 1.1.1f 31 Mar 2020, LZO 2.10
Enter Management Password:
Wed Jun 17 18:11:43 2020 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
Wed Jun 17 18:11:43 2020 Need hold release from management interface, waiting...
Wed Jun 17 18:11:44 2020 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'state on'
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'log all on'
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'echo all on'
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'bytecount 5'
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'hold off'
Wed Jun 17 18:11:44 2020 MANAGEMENT: CMD 'hold release'
Wed Jun 17 18:11:44 2020 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
Wed Jun 17 18:11:44 2020 MANAGEMENT: >STATE:1592410304,RESOLVE,,,,,,
Wed Jun 17 18:11:44 2020 TCP/UDP: Preserving recently used remote address: [AF_INET]XX.XXX.XX.XXX:1194
Wed Jun 17 18:11:44 2020 Socket Buffers: R=[65536->65536] S=[65536->65536]
Wed Jun 17 18:11:44 2020 UDP link local: (not bound)
Wed Jun 17 18:11:44 2020 UDP link remote: [AF_INET]XX.XXX.XX.XXX:1194
Wed Jun 17 18:11:44 2020 MANAGEMENT: >STATE:1592410304,WAIT,,,,,,
Wed Jun 17 18:11:44 2020 MANAGEMENT: >STATE:1592410304,AUTH,,,,,,
Wed Jun 17 18:11:44 2020 TLS: Initial packet from [AF_INET]XX.XXX.XX.XXX:1194, sid=4d1cfe63 07d70714
Wed Jun 17 18:11:44 2020 VERIFY OK: depth=1, C=DE, ST=BW, L=XXXXX, O=XXXXX, OU=IT, CN=vpn.XXXXX.com, name=XXXXXOpenVPNKey, emailAddress=it@XXXXX.com
Wed Jun 17 18:11:44 2020 VERIFY OK: depth=0, C=DE, ST=BW, L=XXXXX, O=XXXXX, OU=IT, CN=vpn.XXXXX.com, name=XXXXXVPNKey, emailAddress=it@XXXXX.com
Wed Jun 17 18:11:44 2020 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, 4096 bit RSA
Wed Jun 17 18:11:44 2020 [vpn.XXXXX.com] Peer Connection Initiated with [AF_INET]79.235.60.191:1194
Wed Jun 17 18:11:45 2020 MANAGEMENT: >STATE:1592410305,GET_CONFIG,,,,,,
Wed Jun 17 18:11:45 2020 SENT CONTROL [vpn.XXXXX.com]: 'PUSH_REQUEST' (status=1)
Wed Jun 17 18:11:46 2020 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 192.168.2.1,route 192.168.2.0 255.255.255.0,compress lz4-v2,route-gateway 192.168.2.99,ping 10,ping-restart 120,ifconfig 192.168.2.100 255.255.255.0,peer-id 1,cipher AES-256-GCM'
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: timers and/or timeouts modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: compression parms modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: --ifconfig/up options modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: route options modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: route-related options modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: peer-id set
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: adjusting link_mtu to 1657
Wed Jun 17 18:11:46 2020 OPTIONS IMPORT: data channel crypto options modified
Wed Jun 17 18:11:46 2020 Data Channel: using negotiated cipher 'AES-256-GCM'
Wed Jun 17 18:11:46 2020 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Jun 17 18:11:46 2020 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
Wed Jun 17 18:11:46 2020 interactive service msg_channel=0
Wed Jun 17 18:11:46 2020 ROUTE_GATEWAY 192.168.178.1/255.255.255.0 I=33 HWADDR=d0:37:45:03:6e:cb
Wed Jun 17 18:11:46 2020 open_tun
Wed Jun 17 18:11:46 2020 TAP-WIN32 device [tap-adapter] opened: \\.\Global\{8752C6AA-1D27-4E85-A8BA-25DC300768F0}.tap
Wed Jun 17 18:11:46 2020 TAP-Windows Driver Version 9.24
Wed Jun 17 18:11:46 2020 Notified TAP-Windows driver to set a DHCP IP/netmask of 192.168.2.100/255.255.255.0 on interface {8752C6AA-1D27-4E85-A8BA-25DC300768F0} [DHCP-serv: 192.168.2.0, lease-time: 31536000]
Wed Jun 17 18:11:46 2020 Sleeping for 3 seconds...
Wed Jun 17 18:11:49 2020 Successful ARP Flush on interface [24] {8752C6AA-1D27-4E85-A8BA-25DC300768F0}
Wed Jun 17 18:11:49 2020 MANAGEMENT: >STATE:1592410309,ASSIGN_IP,,192.168.2.100,,,,
Wed Jun 17 18:11:54 2020 TEST ROUTES: 1/1 succeeded len=1 ret=1 a=0 u/d=up
Wed Jun 17 18:11:54 2020 MANAGEMENT: >STATE:1592410314,ADD_ROUTES,,,,,,
Wed Jun 17 18:11:54 2020 C:\WINDOWS\system32\route.exe ADD 192.168.2.0 MASK 255.255.255.0 192.168.2.99
Wed Jun 17 18:11:54 2020 ROUTE: CreateIpForwardEntry succeeded with dwForwardMetric1=25 and dwForwardType=4
Wed Jun 17 18:11:54 2020 Route addition via IPAPI succeeded [adaptive]
Wed Jun 17 18:11:54 2020 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
Wed Jun 17 18:11:54 2020 Initialization Sequence Completed
Wed Jun 17 18:11:54 2020 MANAGEMENT: >STATE:1592410314,CONNECTED,SUCCESS,192.168.2.100,79.235.60.191,1194,,
CMD / ipconfig @ client
Unbekannter Adapter tap-adapter:
Verbindungsspezifisches DNS-Suffix:
Beschreibung. . . . . . . . . . . : TAP-Windows Adapter V9
Physische Adresse . . . . . . . . : 00-FF-87-52-C6-AA
DHCP aktiviert. . . . . . . . . . : Ja
Autokonfiguration aktiviert . . . : Ja
Verbindungslokale IPv6-Adresse . : fe80::848e:c76d:86e3:6c44%24(Bevorzugt)
IPv4-Adresse . . . . . . . . . . : 192.168.2.100(Bevorzugt)
Subnetzmaske . . . . . . . . . . : 255.255.255.0
Lease erhalten. . . . . . . . . . : Mittwoch, 17. Juni 2020 18:11:46
Lease läuft ab. . . . . . . . . . : Donnerstag, 17. Juni 2021 18:11:45
Standardgateway . . . . . . . . . : 0.0.0.0
DHCP-Server . . . . . . . . . . . : 192.168.2.0
DHCPv6-IAID . . . . . . . . . . . : 83951495
DHCPv6-Client-DUID. . . . . . . . : 00-01-00-01-23-EF-31-60-BC-AE-C5-11-A0-10
DNS-Server . . . . . . . . . . . : 192.168.2.1
NetBIOS über TCP/IP . . . . . . . : Aktiviert
CMD / route print @ client
IPv4-Routentabelle
===========================================================================
Aktive Routen:
Netzwerkziel Netzwerkmaske Gateway Schnittstelle Metrik
0.0.0.0 0.0.0.0 192.168.178.1 192.168.178.155 55
0.0.0.0 0.0.0.0 Auf Verbindung 192.168.2.100 281
127.0.0.0 255.0.0.0 Auf Verbindung 127.0.0.1 331
127.0.0.1 255.255.255.255 Auf Verbindung 127.0.0.1 331
127.255.255.255 255.255.255.255 Auf Verbindung 127.0.0.1 331
169.254.0.0 255.255.0.0 Auf Verbindung 169.254.137.227 281
169.254.137.227 255.255.255.255 Auf Verbindung 169.254.137.227 281
169.254.255.255 255.255.255.255 Auf Verbindung 169.254.137.227 281
192.168.2.0 255.255.255.0 Auf Verbindung 192.168.2.100 281
192.168.2.0 255.255.255.0 192.168.2.99 192.168.2.100 25
192.168.2.100 255.255.255.255 Auf Verbindung 192.168.2.100 281
192.168.2.255 255.255.255.255 Auf Verbindung 192.168.2.100 281
192.168.178.0 255.255.255.0 Auf Verbindung 192.168.178.155 311
192.168.178.155 255.255.255.255 Auf Verbindung 192.168.178.155 311
192.168.178.255 255.255.255.255 Auf Verbindung 192.168.178.155 311
224.0.0.0 240.0.0.0 Auf Verbindung 127.0.0.1 331
224.0.0.0 240.0.0.0 Auf Verbindung 169.254.137.227 281
224.0.0.0 240.0.0.0 Auf Verbindung 192.168.2.100 281
224.0.0.0 240.0.0.0 Auf Verbindung 192.168.178.155 311
255.255.255.255 255.255.255.255 Auf Verbindung 127.0.0.1 331
255.255.255.255 255.255.255.255 Auf Verbindung 169.254.137.227 281
255.255.255.255 255.255.255.255 Auf Verbindung 192.168.2.100 281
255.255.255.255 255.255.255.255 Auf Verbindung 192.168.178.155 311
===========================================================================
Ständige Routen:
Netzwerkadresse Netzmaske Gatewayadresse Metrik
0.0.0.0 0.0.0.0 192.168.2.100 Standard