A networking newbie here. I setup an OpenVPN server in my home network so that I can use public Wi-Fi to first connect to my home network, and then use the Internet with some degree of security. I followed this tutorial to set it up: https://www.digitalocean.com/community/tutorials/how-to-set-up-an-openvpn-server-on-ubuntu-14-04. As far as I can tell, it's a very simple tunneling type OpenVPN setup. When working normal, I can access the Internet through this OpenVPN server, as well as connect to servers in my home network.
However I noticed a problem. My home IPv4 network range is
10.0.1.0/24, which is the default that came with my Mac AirPort Extreme router. When I go to a friend's house, or another public place whose router also uses the
10.0.1.0/24 IPv4 range, I can connect to my home network, but I can't access anything there. The reason is obvious: the local network I am at uses the same range and default gateway as my home setup.
I could change my network range, but then I would encounter a similar problem every time someone's local IPv4 network range was the same.
My question is: what sort of setup would I need to avoid this problem? Is this the reason to use a TAP setup rather then TUN? I'm more looking for a place to get started. Here's my server config:
port 1194 proto udp dev tun ca ca.crt cert server.crt dh dh2048.pem server 10.8.0.0 255.255.255.0 # IP range for connecting users ifconfig-pool-persist ipp.txt push "redirect-gateway def1 bypass-dhcp" push "dhcp-option DNS 10.0.1.13" # My local DNS server push "dhcp-option DNS 10.0.1.1" # My home router DNS push "dhcp-option DNS 184.108.40.206" # Google public DNS keepalive 10 120 comp-lzo user nobody group nogroup persist-key persist-tun status openvpn-status.log verb 3
**** EDIT 1 ****
I found these resources:
Is there really no way around this problem except for choosing a less-used private IPv4 subnet?