Hello,
J'ai réussi à installer et configurer mon serveur openvpn sous Debian 10 ainsi que mon client sous Windows.
Tout fonctionne bien SAUF que je ne peux acceder, en direct, qu'au serveur VPN. Bien sur, en rebond depuis celui ci aucun soucis ... Cependant, depuis ma machine Windows, je devrais acceder, si j'ai tout bien fait, à l'intégralité du réseau.
Le réseau : 192.168.0.1/24
L'IP du serveur VPN / 192.168.0.254
server.conf
port 1194
proto udp
dev tun
ca /etc/openvpn/pki/ca.crt # generated keys
cert /etc/openvpn/pki/issued/server.crt
key /etc/openvpn/pki/private/server.key # keep secret
dh /etc/openvpn/pki/dh.pem
server 10.50.8.0 255.255.255.0 # internal tun0 connection IP
ifconfig-pool-persist ipp.txt
keepalive 10 120
comp-lzo # Compression - must be turned on at both end
persist-key
persist-tun
push "dhcp-option DNS 192.168.0.1"
push "dhcp-option DOMAIN std.local"
push "route 192.168.0.0 255.255.255.0"
status /var/log/openvpn-status.log
verb 3 # verbose mode
J'ai ajouté ma regle iptable :
iptables -t nat -A POSTROUTING -s 10.50.8.0/24 -o enp2s0 -j MASQUERADE
Ainsi que le forward au niveau sysctl.conf
Tout à été bien fait , je pense ... pourtant je ne peux que me connecter directement à la 192.168.0.254
Log d'une connexion succès :
2021-07-07 12:04:38 MANAGEMENT: TCP Socket listening on [AF_INET]127.0.0.1:25340
2021-07-07 12:04:38 Need hold release from management interface, waiting...
2021-07-07 12:04:38 MANAGEMENT: Client connected from [AF_INET]127.0.0.1:25340
2021-07-07 12:04:38 MANAGEMENT: CMD 'state on'
2021-07-07 12:04:38 MANAGEMENT: CMD 'log all on'
2021-07-07 12:04:38 MANAGEMENT: CMD 'echo all on'
2021-07-07 12:04:38 MANAGEMENT: CMD 'bytecount 5'
2021-07-07 12:04:38 MANAGEMENT: CMD 'hold off'
2021-07-07 12:04:38 MANAGEMENT: CMD 'hold release'
2021-07-07 12:04:38 WARNING: No server certificate verification method has been enabled. See http://openvpn.net/howto.html#mitm for more info.
2021-07-07 12:04:38 TCP/UDP: Preserving recently used remote address: [AF_INET]90.110.127.209:1194
2021-07-07 12:04:38 Socket Buffers: R=[65536->65536] S=[65536->65536]
2021-07-07 12:04:38 UDP link local: (not bound)
2021-07-07 12:04:38 UDP link remote: [AF_INET]90.110.127.209:1194
2021-07-07 12:04:38 MANAGEMENT: >STATE:1625652278,WAIT,,,,,,
2021-07-07 12:04:39 MANAGEMENT: >STATE:1625652279,AUTH,,,,,,
2021-07-07 12:04:39 TLS: Initial packet from [AF_INET]90.110.127.209:1194, sid=d67314b8 7c0f2e1a
2021-07-07 12:04:39 VERIFY OK: depth=1, CN=openvpn-host
2021-07-07 12:04:39 VERIFY OK: depth=0, CN=server
2021-07-07 12:04:39 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA256
2021-07-07 12:04:39 [server] Peer Connection Initiated with [AF_INET]90.110.127.209:1194
2021-07-07 12:04:40 MANAGEMENT: >STATE:1625652280,GET_CONFIG,,,,,,
2021-07-07 12:04:40 SENT CONTROL [server]: 'PUSH_REQUEST' (status=1)
2021-07-07 12:04:40 PUSH: Received control message: 'PUSH_REPLY,dhcp-option DNS 192.168.0.1,dhcp-option DOMAIN std.local,route 192.168.0.0 255.255.255.0,route 10.50.8.1,topology net30,ping 10,ping-restart 120,ifconfig 10.50.8.6 10.50.8.5,peer-id 0,cipher AES-256-GCM'
2021-07-07 12:04:40 OPTIONS IMPORT: timers and/or timeouts modified
2021-07-07 12:04:40 OPTIONS IMPORT: --ifconfig/up options modified
2021-07-07 12:04:40 OPTIONS IMPORT: route options modified
2021-07-07 12:04:40 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
2021-07-07 12:04:40 OPTIONS IMPORT: peer-id set
2021-07-07 12:04:40 OPTIONS IMPORT: adjusting link_mtu to 1625
2021-07-07 12:04:40 OPTIONS IMPORT: data channel crypto options modified
2021-07-07 12:04:40 Data Channel: using negotiated cipher 'AES-256-GCM'
2021-07-07 12:04:40 Outgoing Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
2021-07-07 12:04:40 Incoming Data Channel: Cipher 'AES-256-GCM' initialized with 256 bit key
2021-07-07 12:04:40 interactive service msg_channel=592
2021-07-07 12:04:40 ROUTE_GATEWAY 192.168.137.180/255.255.255.0 I=18 HWADDR=28:7f:cf:0f:d8:cc
2021-07-07 12:04:40 open_tun
2021-07-07 12:04:40 tap-windows6 device [OpenVPN TAP-Windows6] opened
2021-07-07 12:04:40 TAP-Windows Driver Version 9.24
2021-07-07 12:04:40 Notified TAP-Windows driver to set a DHCP IP/netmask of 10.50.8.6/255.255.255.252 on interface {64CCF10A-543B-4BC4-8866-5E7210D44813} [DHCP-serv: 10.50.8.5, lease-time: 31536000]
2021-07-07 12:04:40 Successful ARP Flush on interface [43] {64CCF10A-543B-4BC4-8866-5E7210D44813}
2021-07-07 12:04:40 MANAGEMENT: >STATE:1625652280,ASSIGN_IP,,10.50.8.6,,,,
2021-07-07 12:04:40 IPv4 MTU set to 1500 on interface 43 using service
2021-07-07 12:04:45 TEST ROUTES: 2/2 succeeded len=2 ret=1 a=0 u/d=up
2021-07-07 12:04:45 MANAGEMENT: >STATE:1625652285,ADD_ROUTES,,,,,,
2021-07-07 12:04:45 C:\WINDOWS\system32\route.exe ADD 192.168.0.0 MASK 255.255.255.0 10.50.8.5
2021-07-07 12:04:45 Route addition via service succeeded
2021-07-07 12:04:45 C:\WINDOWS\system32\route.exe ADD 10.50.8.1 MASK 255.255.255.255 10.50.8.5
2021-07-07 12:04:45 Route addition via service succeeded
2021-07-07 12:04:45 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
2021-07-07 12:04:45 Initialization Sequence Completed
2021-07-07 12:04:45 MANAGEMENT: >STATE:1625652285,CONNECTED,SUCCESS,10.50.8.6,90.110.127.209,1194,,
2021-07-07 12:06:04 C:\WINDOWS\system32\route.exe DELETE 192.168.0.0 MASK 255.255.255.0 10.50.8.5
2021-07-07 12:06:04 Route deletion via service succeeded
2021-07-07 12:06:04 C:\WINDOWS\system32\route.exe DELETE 10.50.8.1 MASK 255.255.255.255 10.50.8.5
2021-07-07 12:06:04 Route deletion via service succeeded
2021-07-07 12:06:04 Closing TUN/TAP interface
2021-07-07 12:06:04 TAP: DHCP address released
2021-07-07 12:06:04 SIGTERM[hard,] received, process exiting
2021-07-07 12:06:04 MANAGEMENT: >STATE:1625652364,EXITING,SIGTERM,,,,,
Merci de votre aide