OpenVPN Client, selective routing AND Dnsmasq


Occasional Visitor

I hope someone can advice what I'm missing.
I'm trying to get the following to work

1. OpenVPN client running on the N66U with selective routing via the VPN for specific URL's using a script which is started when the wan comes up (wan-start).
The script uses "iptables -t mangle -A PREROUTING....." to direct the traffic between direct WAN and VPN Tunnel

2. Smart-DNS / UnBlock DNS configured via dnsmasq for specific URLs to unblock those (e.g. netflix outside the US) using the custom dnsmasq.conf.add config file

Both are working fine independently.

- I can access all the sites configured in the OpenVPN script via the VPN tunnel and all local traffic will bypass the tunnel with the dnsmasq configured or not.

- I can access the pages configured in the dnsmasq settings via the SMART DNS service only when the VPN tunnel and script is disabled when the router comes up.

When both are activated the VPN tunnel still works fine but the SMART DNS is not addressed anymore.

In the log of the router I can see that the dnsmasq settings are applied before the VPN comes up. So I assume that I'm missing a setting which will prevent the VPN from overruling the dnsmasq function?

Can anyone point me in the right direction?

Thanks !!


Part of the Furniture
Captain Haddock here... (looking at your username)

In the asuswrt-merlin Wiki you find under User Scripts a openvpn-event to trigger whatever you want.


Occasional Visitor
Yes, thanks. Issue is that I know what I want but not sure how to put that into code ;-)

Sent from my GT-I9505 using Tapatalk


Part of the Furniture
Post away what you've got, that'll give us a hint where things go wrong.
Last edited:


Occasional Visitor
I might have solved it works now.
No idea what did the trick or whether it will last.

Will report back after some testing

Similar threads

Latest threads

Sign Up For SNBForums Daily Digest

Get an update of what's new every day delivered to your mailbox. Sign up here!