Quick network layout:
10.0.0.1 - Asus router - DHCP set up for 10.0.0.0/21 subnet (10.0.01 - 10.0.7.254).
10.0.1.1 - primary pihole for adblocking
10.0.1.2 - secondary/HA pihole
10.0.1.3 - PiVPN running on an RPi 4 / OpenVPN clients on 10.8.0.0/24
I have several machines I'd like to be able to SSH into remotely via the VPN. However, I'd also like to still have an internet connection available while on the VPN, using my piholes as the DNS servers.
I have the first part of that working fine. While connected to the VPN on my phone, I can access internal devices. However, I cannot browse the internet at all, much less while using my piholes for DNS.
In the past, I think I had somehow used TAP connections to just bridge the VPN and the home network, and it worked fine. Now, however, OpenVPN 3 says it doesn't support TAP anymore? More importantly, I can't use TAP on my non-rooted Pixel. I've been reading up a ton on how I need to set up routes to accomplish what I am describing. I've followed several guides, and I just can't seem to get it working. I understand, conceptually, how the routing is supposed to work, but I can't figure out to implement it.
I'm at my wit's end. I've been trying to learn for Linux stuff for running a home lab box with docker, but the networking side of things is still confusing to me.
Here are the pertinent config files.
OpenVPN server.conf:
Client config:
And then on my router, I have this static route set up:
10.0.0.1 - Asus router - DHCP set up for 10.0.0.0/21 subnet (10.0.01 - 10.0.7.254).
10.0.1.1 - primary pihole for adblocking
10.0.1.2 - secondary/HA pihole
10.0.1.3 - PiVPN running on an RPi 4 / OpenVPN clients on 10.8.0.0/24
I have several machines I'd like to be able to SSH into remotely via the VPN. However, I'd also like to still have an internet connection available while on the VPN, using my piholes as the DNS servers.
I have the first part of that working fine. While connected to the VPN on my phone, I can access internal devices. However, I cannot browse the internet at all, much less while using my piholes for DNS.
In the past, I think I had somehow used TAP connections to just bridge the VPN and the home network, and it worked fine. Now, however, OpenVPN 3 says it doesn't support TAP anymore? More importantly, I can't use TAP on my non-rooted Pixel. I've been reading up a ton on how I need to set up routes to accomplish what I am describing. I've followed several guides, and I just can't seem to get it working. I understand, conceptually, how the routing is supposed to work, but I can't figure out to implement it.
I'm at my wit's end. I've been trying to learn for Linux stuff for running a home lab box with docker, but the networking side of things is still confusing to me.
Here are the pertinent config files.
OpenVPN server.conf:
Code:
dev tun
proto udp
port 1194
ca /etc/openvpn/easy-rsa/pki/ca.crt
cert /etc/openvpn/easy-rsa/pki/issued/pivpn.crt
key /etc/openvpn/easy-rsa/pki/private/pivpn.key
dh none
ecdh-curve prime256v1
topology subnet
server 10.8.0.0 255.255.255.0 # It should add clients to the 10.8.x.x range
push "dhcp-option DNS 10.0.1.1" # PiHole0
push "dhcp-option DNS 10.0.1.2" # PiHole1
push "route 10.0.0.1 255.255.248.0" # Create route to home network gateway?
push "redirect-gateway def1"
client-to-client
client-config-dir /etc/openvpn/ccd
keepalive 15 120
remote-cert-tls client
tls-version-min 1.2
tls-crypt /etc/openvpn/easy-rsa/pki/ta.key
cipher AES-256-CBC
auth SHA256
user openvpn
group openvpn
persist-key
persist-tun
crl-verify /etc/openvpn/crl.pem
status /var/log/openvpn-status.log 20
status-version 3
syslog
verb 3
Client config:
Code:
client
dev tun
proto udp
remote vpn.mydomain.com 1194 # This is a DDNS address
resolv-retry infinite
nobind
remote-cert-tls server
tls-version-min 1.2
verify-x509-name pivpn name
cipher AES-256-CBC
auth SHA256
auth-nocache
verb 3
## Cert info snipped for privacy/brevity
And then on my router, I have this static route set up:
Code:
Network/Host IP Netmask Gateway Interface
10.8.0.0 255.255.255.0 10.0.1.3 LAN