Fixing AdGuard on GL.iNet Router with VPN DNS Configuration
Fixing AdGuard on GL.iNet Router with VPN DNS Configuration
If you’re using AdGuardHome with a GL.iNet router on a VPN setup, follow these steps to configure AdGuard to work smoothly with VPN-based DNS.
Show clients with their identifier instead of “localhost”
Set the following port forwarding rule in OpenWrt:
Step-by-Step Instructions
1. Configure DNS in VPN Server and Client Configuration
- SSH into the Router
- Use SSH to access the router (GL.iNet) by connecting to
192.168.8.1. Ifsshdoesn’t connect directly, usedbclient:dbclient root@192.168.8.1
- Use SSH to access the router (GL.iNet) by connecting to
- Edit the OpenVPN Server Configuration
- Open the OpenVPN server configuration file to add the DNS option for the VPN:
vi /etc/openvpn/ovpn/server.ovpn -
Add the following line to push the VPN DNS to clients:
push "dhcp-option DNS 10.8.0.1" - Here,
10.8.0.1represents the VPN network IP address, which serves as the DNS.
- Open the OpenVPN server configuration file to add the DNS option for the VPN:
- Edit the Client Configuration
-
In the VPN client configuration (
client.ovpn), ensure this DNS setting is also specified:dhcp-option DNS 10.8.0.1
-
2. Modify AdGuard for Standard Login Access
To access AdGuard with a standard login (rather than GL.iNet’s default setup), update the AdGuardHome configuration.
- Edit AdGuardHome Startup Script
- Open the AdGuardHome startup script:
vim /etc/init.d/AdGuardHome - Remove
--glinetfrom the command line in this file:procd_set_param command /usr/bin/AdGuardHome -c /etc/AdGuardHome/config.yaml -w /etc/AdGuardHome -l syslog
- Open the AdGuardHome startup script:
- Set Up a Username and Password
-
To configure a login for AdGuard, use the following command to create a username and password:
htpasswd -B -C 10 -n -b <USERNAME> <PASSWORD> -
This command generates a hash that will look like:
<USERNAME>:<HASH>
-
- Edit the AdGuard Configuration File
- Open the AdGuard configuration file:
vim /etc/AdGuardHome/config.yml -
Add the user credentials under the
userssection:users: - name: <USERNAME> password: <HASH>
- Open the AdGuard configuration file:
By following these steps, you can ensure that AdGuard operates effectively on a GL.iNet router using VPN DNS and provides secure login access. This setup allows AdGuard to handle DNS queries via the VPN network and secures access with a username and password.
Comments