I am having some trouble with my openvpn installation. Everything is working properly from my home wifi and cellular, the issue is at work. I can connect to no problem and browse the internet but when I try to access a local (to the vpn) resource I get a cryptic error on my iphone:
"Safari cannot open the page because it could not establish a secure connection to the server"
I can browse the local website when connected from my work laptop via the vpn with no issues. When I look in the nginx logs there are no references to the iphone trying to connect so it must be losing the traffic before it hits the webserver but I am at a loss to see why if it works on my windows work laptop.
Here is my server.conf
port 1194
proto udp
dev tun
ca ca.crt
cert server.crt
key server.key # This file should be kept secret
dh dh2048.pem
server 10.8.0.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 208.67.222.222"
push "dhcp-option DNS 208.67.220.220"
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status /var/log/openvpn.status
verb 4
crl-verify crl.pem
topology subnet
And here is the client config:
client
dev tun
proto udp
remote server.address.com 1194
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 4
<ca>
-----BEGIN CERTIFICATE-----
xxx-----END CERTIFICATE-----
</ca>
<cert>
-----BEGIN CERTIFICATE-----
xxx
</cert>
<key>
-----BEGIN PRIVATE KEY-----
xxxxx
-----END PRIVATE KEY-----
</key>
I have also tried using a vpn service via the same OpenVPN app on ios and I am able to reach the vpn server's websites no problem. So I am thinking there must be an issue with passing the local traffic through the vpn on the server but unfortunately I am unable to find the solution.
I have also double checked that ip_forwarding is enabled and I have a rule in iptables to allow forwarding as well as accept traffic from the devices:
-A POSTROUTING -s 10.8.0.0/8 -o p1p1 -j SNAT --to-source 123.456.789.000 (my public ip)
net.ipv4.ip_forward
-A INPUT -i tun+ -j ACCEPT
If someone could tell me where I went wrong or what I missed it would be greatly appreciated. Thanks for taking the time!
Paul