What's new
  • SNBForums Code of Conduct

    SNBForums is a community for everyone, no matter what their level of experience.

    Please be tolerant and patient of others, especially newcomers. We are all here to share and learn!

    The rules are simple: Be patient, be nice, be helpful or be gone!

Diversion [Solved] Adblock is bypassed by SSH tunneling into the router

ghorvath

New Around Here
I tried this both with ASUSWRT-Merlin TUF-AX5400 3004.388.9_2-gnuton2 and ASUSWRT-Merlin RT-AX56U 3004.388.8_4 with Diversion 5.4.6 (+Skynet 7.6.5 if it matters), DNS Director is enabled with Global redirection set to Router. I enabled the large filtering (https://big.oisd.nl/dnsmasq2) plus one from StevenBlack (https://raw.githubusercontent.com/S.../alternates/fakenews-gambling-porn-only/hosts)

Diversion works perfectly for machines or phones on LAN, filters out everything defined by the blocklists.

I have one port open to the outside world where dropbear listens with ssh (only private keys, no password allowed on this port). When I ssh into the router with dynamic port forwarding to a port from my laptop, and then set my firefox to use socks5 with this port, and even set the proxying of DNS via socks5, as well, then none of the sites are blocked. Those DNS calls are going through the ssh tunnel on socks5, and not using the local router's DNS, because that also has a working adblocking. But I can't see them on the tunneled router's diversion logs, which is consistent with the undesired behaviour that ads appear.

Is there some trivial setting I am missing that will make sure that all SSH tunneled traffic is also going through Diversion or dnsmasq?
 
The router won't use it's own dnsmasq server for lookups, but I'm not sure how this is supposed to be working anyway based on your description. Most people will just setup a VPN Server on the router and connect using a VPN client (Wireguard or OpenVPN).
 
OK, I made a similar setup on my router and I see the DNS will originate from the local router using the servers defined in /etc/resolv.conf, which will go directly to the WAN DNS servers, bypassing dnsmasq and Diversion.
It has got to be caused by the router specifically treating the ssh traffic as originating from itself. The only way around this specific type of behavior would be to make the router its own local caching resolver, or override /etc/resolv.conf via mount bind. I would recommend it is better to use the VPN site tunnel to skip having to do such, but everyone has their own reasons to do what they do.
 
Last edited:
It has got to be caused by the router specifically treating the ssh traffic as originating from itself. The only way around this specific type of behavior would be to make the router its own local caching resolver...
There's an option to do this in the "Advanced Tweaks and Hacks" section of Merlin's firmware.
 

Latest threads

Support SNBForums w/ Amazon

If you'd like to support SNBForums, just use this link and buy anything on Amazon. Thanks!

Sign Up For SNBForums Daily Digest

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