can't push dns server to clients
Posted: Tue Aug 24, 2021 12:59 pm
I am running OpenVPN server on EdgeRouter. I am running OpenVPN client on Android. I route all traffic from phone trough openvpn and I can use internet just fine. I can also connect private servers behind the OpenVPN-firewall, but only by their IP. When I use tcpdump on EdgeRouter to listen DNS traffic, I see that that my phone uses 8.8.8.8 to resolv it's name requests. Not my DNS server I am trying to push to it (10.0.0.1).
My server config is following:
My phone has the following configuration:
In addition to these, I have a client config in the ccd directory that holds the following
But for some reason, everything else works but the DNS. I've tried to set it directly in the client config by adding dhcp-option directly there instead of pushing it from server. But I can't get DNS to work. The phone is Xiaomi and OpenVPN Connect version is 3.2.5.(7182)
My server config is following:
Code: Select all
daemon
server 10.10.0.0 255.255.255.0
proto udp
port 1194
dev vtun0
cipher AES-128-CBC
comp-lzo yes
keepalive 15 60
verb 3
push "route 10.0.0.0 255.255.255.0"
ca /config/user-data/openvpn/ca.crt
dh /config/user-data/openvpn/dh.pem
cert /config/user-data/openvpn/server.crt
key /config/user-data/openvpn/server.key
status-version 2
status status
client-config-dir /config/user-data/openvpn/ccd
client-to-client
topology subnet
route 10.0.1.0 255.255.255.0
route 10.0.2.0 255.255.255.0
Code: Select all
client
dev tun
proto udp
remote <server-host-name> 1194
redirect-gateway def1
resolv-retry infinite
pull
nobind
persist-key
persist-tun
cipher AES-128-CBC
verb 1
comp-lzo
route 10.0.1.0 255.255.255.0
route 10.0.2.0 255.255.255.0
Code: Select all
push "dhcp-option DNS 10.0.0.1"