Hello friends, here again requesting a little of your help.
I have been following some tutorials to install OpenVPN and I have succeeded, keep in mind that this is my first foray into the VPN world.
But, I have been presented with the following problem.
I have started the Openvpn server on PC1 with IPLAN 192.168.0.10 /gateway 192.168.0.1/mask 255.255.255.0
IP VPN 10.8.0.1
Router LAN IP 192.168.0.1 / Public IP 200.221.128.3
DMZ 192.168.0.10
another PC2 with LAN IP 192.168.0.20
IP VPN 10.8.0.2
although PC2 obtains internet through a wifi hotspot to access the public ip 200.221.128.3:1194 of the openvpn server on PC1 with IPLAN 192.168.0.10
having the vpn client started, there is a ping between both ip vpn 10.8.0.1 and 10.8.0.2
but I do not have access to the internet, I cannot get the PC2 client to obtain the public IP of PC1 when consulting the page
https://www.whatismyip.com/
I have come to take into account the commands contained in this script:
https://raw.githubusercontent.com/Angristan/openvpn-install/master/openvpn-install.sh
but my head is a bit confused, for this reason I ask for your guidance. I leave attached to this post the server and client configuration files.
sysctl -p
net.ipv4.ip_forward = 1
port 1194
proto udp
dev tun
ca /etc/openvpn/server/ca.crt
cert /etc/openvpn/server/server-openvpn.crt
key /etc/openvpn/server/server-openvpn.key
dh /etc/openvpn/server/dh2048.pem
topology subnet
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "route 192.168.0.0 255.255.255.0"
push "redirect-gateway def1"
push "dhcp-option DNS 8.8.4.4"
push "dhcp-option DNS 8.8.8.8"
client-to-client
keepalive 10 120
tls-crypt /etc/openvpn/server/ta.key 0
remote-cert-tls client
cipher AES-256-GCM
tls-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256
ecdh-curve secp521r1
tls-version-min 1.2
reneg-sec 0
auth SHA512
;compress lz4-v2
;push "compress lz4-v2"
comp-lzo
max-clients 5
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
explicit-exit-notify 1
client
dev tun
proto udp
remote 200.221.128.3 1194
#remote 192.168.0.10 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
mute-replay-warnings
ca /etc/openvpn/client/ca.crt
cert /etc/openvpn/client/client1-openvpn.crt
key /etc/openvpn/client/client1-openvpn.key
remote-cert-tls server
tls-crypt /etc/openvpn/client/ta.key 1
cipher AES-256-GCM
auth SHA512
auth-nocache
;compress lz4-v2
tls-ciphersuites TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-256-GCM-SHA384:TLS-ECDHE-ECDSA-WITH-CHACHA20-POLY1305-SHA256
comp-lzo
verb 3
If you need to know the result of any command like route -n or another, tell me and I'll put it.
Thank you very much in advance for your guidance.