I installed OpenVPN server successfully on a server (X.X.X.X/32). Here is my OpenVPN config file:
port 1194proto udp6dev tunca /etc/openvpn/keys/ca.crtcert /etc/openvpn/keys/server.crtkey /etc/openvpn/keys/server.keydh /etc/openvpn/keys/dh.pemcrl-verify /etc/openvpn/keyscrl-verify /etc/openvpn/keys/ca-crl.pemtls-auth /etc/openvpn/keys/ta.key 0tls-serverauth SHA256cipher AES-256-CBCtls-version-min 1.2tls-cipher TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-RSA-WITH-AES-256-GCM-SHA384:TLS-DHE-RSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-ECDSA-WITH-AES-256-CBC-SHA384:TLS-ECDHE-RSA-WITH-AES-256-CBC-SHA384:TLS-DHE-RSA-WITH-AES-256-CBC-SHA256server 10.109.0.0 255.255.0.0ifconfig-pool-persist ipp.txtpush "route 192.168.59.0 255.255.255.0"keepalive 5 30compress lzopersist-keypersist-tunuser nobodygroup nogroupstatus openvpn-status.logstatus-version 1log-append /var/log/openvpn.logverb 3
On that server (X.X.X.X/32) I have a vagrant machine running in (host-only network) private network (vm.network 'private_network') with ip 192.168.59.2.
After connecting to OpenVPN from my localhost I would like to ping 192.168.59.2. I can only ping 192.168.59.1. As you can see Vagrant private network, and OpenVPN network is different. Please somebody can help with this issue? I'm also attaching my ovpn (snippet) file:
tls-clientauth SHA256cipher AES-256-CBCremote-cert-tls servertls-version-min 1.2proto udpremote X.X.X.X 1194dev tunresolv-retry 5nobindkeepalive 5 30compress lzopersist-keypersist-tunverb 3route-method exeroute-delay 2key-direction 1
EDIT1:I'm using 192.168.59.2 because vagrant shows a warning for vagrant up
:
guest: You assigned a static IP ending in ".1" to this machine. ==> guest: This is very often used by the router and can cause the ==> guest: network to not work properly. If the network doesn't work ==> guest: properly, try changing this IP.
route -n output on Vagrant machine:
Destination Gateway Genmask Flags Metric Ref Use Iface0.0.0.0 10.0.2.2 0.0.0.0 UG 100 0 0 enp0s310.0.2.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s310.0.2.2 0.0.0.0 255.255.255.255 UH 100 0 0 enp0s3172.17.0.0 0.0.0.0 255.255.0.0 U 0 0 0 docker0192.168.59.0 0.0.0.0 255.255.255.0 U 0 0 0 enp0s8
EDIT2:Vagrant's machine ip changed to 192.168.59.1
. I also added the following line to ovpn file:route 192.168.59.0 255.255.255.0
From localhost I can now ping 192.168.59.1
after connecting to vpn, but I'm still unable to ping 192.168.59.2
.