Martineau
Part of the Furniture
Working!
I suggest you don't hardcode the RPDB rule in nat-start, perhaps you should considerI have added rule
in nat-startCode:ip rule add from 192.168.1.8/29 to 198.18.0.1 table ovpnc1 prio 8001
/jffs/scripts/vpnclient1-route-up
Also don't hard-code the VPN DNS using
as the 'UseDNSOnly' GUI entry as shown in post #17 will correctly build the DNSVPNx chain and the forced Exclusive DNS will be applied.
Furthermore, if the VPN ISP change their DNS servers, then you wouldn't know until the VPN connection acted "weird", so this method ensures the Exclusive DNS configuration is always correct.
Code:
#!/bin/sh
VPN_ID=${dev:4:1}
VPNDNS="$(iptables -t nat -L DNSVPN${VPN_ID} 2>/dev/null | grep -E -m 1 "^DNAT" | awk 'BEGIN { FS = ":" } {print $2}')"
if [ -n "$VPNDNS" ];then
DNSONLY_IPS="$(nvram get vpn_client${VPN_ID}_clientlist | sed -n 's/^.*UseDNSOnly\>//p' | tr '>' ' ' | awk '{print $1}')"
ip rule del prio 800$VPN_ID
ip rule add from $DNSONLY_IPS to $VPNDNS table 11$VPN_ID prio 800$VPN_ID
logger -st "($(basename $0))" "Forcing DNS Server $VPNDNS requests via VPN Client $VPN_ID tunnel"
fi
Code:
dhcp-option 'xxx.xxx.xxx.xxx'
Furthermore, if the VPN ISP change their DNS servers, then you wouldn't know until the VPN connection acted "weird", so this method ensures the Exclusive DNS configuration is always correct.
Additionally, in nat-start you should prevent the creation of duplicates RPDB rules...
Code:
# Ensure duplicate rules are not created as nat-start can be called several times.
for VPN_ID in 0 1 2 3 4 5
do
ip rule del prio 999$VPN_ID 2>/dev/null
done
Regarding the DNS Leak test, do both of these ipleak.net test and dnsleaktest.com test also indicate a DNS Leak?
Anyway glad you finally got it working to your satisfaction.
Last edited: