Dnscrypt-proxy: Netgear Routers running Voxel Firmware - New Wiki Page Worthy?

Created on 26 Apr 2019  Â·  6Comments  Â·  Source: DNSCrypt/dnscrypt-proxy

Voxel has compiled DNSCrypt-Proxy v2 into his firmware builds

https://github.com/SVoxel/R7800
https://github.com/SVoxel/R9000

https://www.voxel-firmware.com/Downloads/Voxel/html/index.html

Supported routers (Netgear R7800, R8900, and R9000)

To enable DNSCrypt-Proxy v2, run these commands from telnet/ssh console:

  • nvram set dnscrypt2=1
  • nvram commit​
  • Reboot your router.

To disable DNSCrypt-Proxy v2, run these commands from telnet/ssh console:

  • nvram set dnscrypt2=0
  • nvram commit​
  • Reboot your router.​

To display DNSCrypt-Proxy log, run these commands from telnet/ssh console:

  • cat /var/log/dnscrypt-proxy-2.log

To schedule a job to automatically update the blacklist.txt file every morning at 4:00am, run these commands from telnet/ssh console:

  1. Create update_blacklist.sh:
  • echo '#!/bin/sh' >/usr/bin/update_blacklist.sh
  • echo 'wget -O /etc/blacklist.txt https://download.dnscrypt.info/blacklists/domains/mybase.txt' >>/usr/bin/update_blacklist.sh
  • echo '[ $? -ne 0 ] && exit 1' >>/usr/bin/update_blacklist.sh
  • echo '/etc/init.d/dnscrypt-proxy-2 restart' >>/usr/bin/update_blacklist.sh
  1. Make update_blacklist.sh executable:
  • chmod +x /usr/bin/update_blacklist.sh
  1. Manually run (or to simply test) update_blacklist.sh:
  • /usr/bin/update_blacklist.sh
  1. Backup rc.local file:
  • [ ! -e /etc/rc.local.bak ] && cp -p /etc/rc.local /etc/rc.local.bak
  1. Create/Schedule Cronjob:
  • echo >>/etc/rc.local
  • echo 'mkdir -p /opt/tmp/cronblacklist/crontabs && echo "0 4 * * * /usr/bin/update_blacklist.sh" >/opt/tmp/cronblacklist/crontabs/root && crond -c /opt/tmp/cronblacklist/crontabs -T '"'"'$($CONFIG get time_zone)'"'"'' >/tmp/x.blacklist
  • sed -n -i -e '/^exit 0/r /tmp/x.blacklist' -e 1x -e '2,${x;p}' -e '${x;p}' /etc/rc.local
  • sed -i '$ { /^$/ d}' /etc/rc.local
  • \rm /tmp/x.blacklist
  1. Reboot your router.

  2. To Uninstall (or undo above):

  • \cp -p /etc/rc.local.bak /etc/rc.local
  • \rm /usr/bin/update_blacklist.sh
  • \rm /etc/blacklist.txt
  • \rm -rf /opt/tmp/cronblacklist/
  • /etc/init.d/dnscrypt-proxy-2 restart
  1. Reboot your router.

To edit the configuration file, run these commands from telnet/ssh console:

  1. vi /etc/dnscrypt-proxy-2.toml [press return]
  2. a [press return] (puts the editor into insert/edit mode)
  3. make your changes
  4. [press esc] :x [press return] (save changes and exit editor)
  5. [press esc] :q! [press return] (exit editor without saving changes)
  6. /usr/sbin/dnscrypt-proxy-2 -config=/etc/dnscrypt-proxy-2.toml -check

To restore the original dnscrypt-proxy-2.toml file, run these commands from telnet/ssh console:

  1. \cp -p /rom/etc/dnscrypt-proxy-2.toml /etc/dnscrypt-proxy-2.toml

To only display the configuration file, run these commands from telnet/ssh console:

  1. cat /etc/dnscrypt-proxy-2.toml
wiki update needed

Most helpful comment

Having dnscrypt-proxy2 in Voxel is great news!

And although I didn't test them, your instructions look excellent.

They should definitely be in the Wiki, as people are less likely to find these useful instructions if they hide in the issues tracker.

All 6 comments

These are all the notes I have taken thus far while running DNSCrypt-Proxy on my Netgear R9000. If the powers that be think they are worthy perhaps a Wiki page could be added for Netgear routers. In any case, please feel free to close/delete/etc this post.

This is the command that is run to start DNSCrypt-Proxy after the router is rebooted:

/usr/sbin/dnscrypt-proxy-2 -config=/etc/dnscrypt-proxy-2.toml -pidfile=/var/run/dnscrypt-proxy-2.pid -logfile=/var/log/dnscrypt-proxy-2.log

Therefore should number 6 in the original post be changed to:

/usr/sbin/dnscrypt-proxy-2 -config=/etc/dnscrypt-proxy-2.toml -pidfile=/var/run/dnscrypt-proxy-2.pid -logfile=/var/log/dnscrypt-proxy-2.log -check

@SVoxel

Having dnscrypt-proxy2 in Voxel is great news!

And although I didn't test them, your instructions look excellent.

They should definitely be in the Wiki, as people are less likely to find these useful instructions if they hide in the issues tracker.

Your product is great, really. I do use it myself. Thanks a lot.

Voxel.

This is fantastic, the arm binary works great with openwrt. Being that DnsCrypt-Proxy-2 IS NOT in the openwrt packages this information is very useful.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Hasshu picture Hasshu  Â·  4Comments

iWARR picture iWARR  Â·  6Comments

dduransseau picture dduransseau  Â·  5Comments

atfreddy picture atfreddy  Â·  3Comments

Ambitious-Dreamer picture Ambitious-Dreamer  Â·  4Comments