My OpenVPN server works fine with:
push "redirect-gateway def1 bypass-dhcp"
However, when I take that out and attempt a split tunnel for one public subnet, it seems like DNS stops working.
I can ping 8.8.8.8 but not google.com
I searched through a lot of posts on this site and serverfault and couldn't find an answer. I've read a lot of the OVPN community docs. I think I'm close though.
Server is Ubuntu 20.04. Clients are Windows 10.
Server config:
port 1194
proto udp
dev tun
user nobody
group nogroup
persist-key
persist-tun
keepalive 10 120
topology subnet
server 10.8.0.0 255.255.0.0
ifconfig-pool-persist ipp.txt
push "dhcp-option DNS 8.8.8.8"
push "dhcp-option DNS 8.8.4.4"
push "route XX.XX.XX.0 255.255.255.0" #anonymized.
push "register-dns"
dh none
ecdh-curve prime256v1
tls-crypt tls-crypt.key
crl-verify crl.pem
ca ca.crt
cert server_rkHwMSTxEAQrnN12.crt
key server_rkHwMSTxEAQrnN12.key
auth SHA256
cipher AES-128-GCM
ncp-ciphers AES-128-GCM
tls-server
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
client-config-dir /etc/openvpn/ccd
status /var/log/openvpn/status.log
log-append /var/log/openvpn/auth.log
plugin /usr/lib/openvpn/openvpn-auth-ldap.so /etc/openvpn/auth-ldap.conf
verify-client-cert optional
verb 3
Client conf
client
proto udp
explicit-exit-notify
remote XX.XX.XX.XX 1194 #anonymized
dev tun
resolv-retry infinite
pull
nobind
persist-key
persist-tun
remote-cert-tls server
verify-x509-name server_rkHwMSTxEAQrnN12 name
auth SHA256
auth-nocache
cipher AES-128-GCM
tls-client
tls-version-min 1.2
tls-cipher TLS-ECDHE-ECDSA-WITH-AES-128-GCM-SHA256
ignore-unknown-option block-outside-dns
setenv opt block-outside-dns # Prevent Windows 10 DNS leak
verb 3
register-dns
auth-user-pass