Client application can't connect out through VPN.
Posted: Sat Mar 26, 2022 12:05 am
Hello.
I have OpenVPN gateway server and client PC connected through it. I can ping out from my client PC through the VPN, route and in first glimpse it seem that everything is working fine and traffic is being routed through VPN well. I have forwarded port 9735 from the server to client and have application listening for connection on client machine on that port. I can reach the port from outside internet fine. All the traffic should be routed through VPN with the use of "redirect-gateway def1", but I still can't get the application to communicate out of my client PC out through the VPN. I'm able to connect to it from outside using port 9735, but when I try to connect to peers from my client, requests times out. I'm not sure why requests are failing from my side.
OpenVPN server is VPS with Ubuntu 18.3
I'm not very good with ip tables and only command I used for routing was to get the traffic coming from outside to move to the tunnel, that seem to have worked ok.
Please find my conf files.
Server.conf:
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1
Client.conf
client
dev tun
proto udp
remote X.X.X.X 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
auth SHA256
verb 3
key-direction 1
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
output of netstat -rn for server

output of netstat -rn for client
[
It would be great is anyone could help me out why my connection requests are failing. I have spend the day to try to resolve it on my own, but I could really use some help.
Thank you!
I have OpenVPN gateway server and client PC connected through it. I can ping out from my client PC through the VPN, route and in first glimpse it seem that everything is working fine and traffic is being routed through VPN well. I have forwarded port 9735 from the server to client and have application listening for connection on client machine on that port. I can reach the port from outside internet fine. All the traffic should be routed through VPN with the use of "redirect-gateway def1", but I still can't get the application to communicate out of my client PC out through the VPN. I'm able to connect to it from outside using port 9735, but when I try to connect to peers from my client, requests times out. I'm not sure why requests are failing from my side.
OpenVPN server is VPS with Ubuntu 18.3
I'm not very good with ip tables and only command I used for routing was
Code: Select all
sudo iptables -t nat -A PREROUTING -p tcp --dport 9735 -j DNAT --to-destination 10.8.0.10:9735
Please find my conf files.
Server.conf:
server config
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist /var/log/openvpn/ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 8.8.8.8"
keepalive 10 120
tls-auth ta.key 0 # This file is secret
cipher AES-256-CBC
auth SHA256
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn/openvpn-status.log
verb 3
explicit-exit-notify 1
Client.conf
client config
client
dev tun
proto udp
remote X.X.X.X 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
remote-cert-tls server
cipher AES-256-CBC
auth SHA256
verb 3
key-direction 1
script-security 2
up /etc/openvpn/update-resolv-conf
down /etc/openvpn/update-resolv-conf
<ca>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
-----END CERTIFICATE-----
</cert>
<key>
-----BEGIN PRIVATE KEY-----
-----END PRIVATE KEY-----
</key>
<tls-auth>
-----BEGIN OpenVPN Static key V1-----
-----END OpenVPN Static key V1-----
</tls-auth>
output of netstat -rn for server

output of netstat -rn for client
[

It would be great is anyone could help me out why my connection requests are failing. I have spend the day to try to resolve it on my own, but I could really use some help.
Thank you!