0

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.

1 Answer 1

0

You probably can't. The issue you are facing is that the path to the external IP address can't go across the VPN as it needs to be accessible across the Internet so the VPN can be set up on top of it.

3
  • Is it possible to route all network to the public ip over the loopback network?
    – Martijn
    Sep 23, 2015 at 12:07
  • No. The loopback onterface is not visible to the remote vpn endpoint so it wont work. If you provide more specifics of your setup there might ne other options like nat+an additional virtual interface or split dns. There is a remote possibility of using policy based routing depending on what ports you need as well.
    – davidgo
    Sep 23, 2015 at 16:29
  • The vpn server uses push redirect-gateway def1.. This means the external IP of the web server (which is the same IP as the vpn server) is only available outside of the vpn (The internal IP 10.8.1.1 is available inside the vpn).
    – dotvotdot
    Sep 26, 2015 at 21:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .