Currently, when I connect to my OpenVPN, I can access the outside world fine but when I try to access the HTTP server running on the same server as OpenVPN is running on, I can't connect to the host. Using the OpenVPN assigned IP (10.8.1.1) does work but some applications don't allow such a configuration (or the ability to change the IP address at all). They want to access the outside facing IP. How do I setup OpenVPN so this functionality is possible?
My configurations are:
client
dev tun
proto tcp
remote xxxx 443
resolv-retry infinite
nobind
user nobody
group nogroup
persist-key
persist-tun
ns-cert-type server
comp-lzo
verb 3
port 443
proto tcp
dev tun
ca ca.crt
cert server.crt
key server.key
dh dh2048.pem
server 10.8.1.0 255.255.255.0
ifconfig-pool-persist ipp.txt
push "redirect-gateway def1 bypass-dhcp"
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
keepalive 10 120
comp-lzo
user nobody
group nogroup
persist-key
persist-tun
status openvpn-status.log
verb 3
I'd like to add that such behavior only occurs when I'm using a public WiFi network that blocks all but 80/tcp
and 443/tcp
.