What's new

DNScrypt dnscrypt installer for asuswrt

  • 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!

If it shows now, you should be able to create a swapfile on it. You can do it manually by entering the following in a terminal

Code:
dd if=/dev/zero of=/tmp/mnt/16GB/myswap.swp bs=1k count=262144
mkswap /tmp/mnt/16GB/myswap.swp
swapon /tmp/mnt/16GB/myswap.swp

That's for a 256Mb swap. If you want a 512Mb swap, replace 262144 with 524288.

To make sure it's activated at reboot, append the following line to /jffs/scripts/post-mount

Code:
swapon /tmp/mnt/16GB/myswap.swp

Check with

Code:
free

whether your swap is active.
Thanks, I had no post mount so I created it and edited the permissions to match the others.

before reboot

Code:
GoNz0@Router:/tmp/home/root# dd if=/dev/zero of=/tmp/mnt/16GB/myswap.swp bs=1k c
ount=524288
524288+0 records in
524288+0 records out
GoNz0@Router:/tmp/home/root# mkswap /tmp/mnt/16GB/myswap.swp
Setting up swapspace version 1, size = 536866816 bytes
UUID=2e4ceeee-b7cc-4e9a-851d-75133e468ee3
GoNz0@Router:/tmp/home/root# swapon /tmp/mnt/16GB/myswap.swp
GoNz0@Router:/tmp/home/root# free
             total       used       free     shared    buffers     cached
Mem:        255700     146496     109204          0       2828      11968
-/+ buffers/cache:     131700     124000
Swap:       524284          0     524284
GoNz0@Router:/tmp/home/root#

After reboot :(

Code:
freeGoNz0@Router:/tmp/home/root# free
             total       used       free     shared    buffers     cached
Mem:        255700     127240     128460          0        704      11788
-/+ buffers/cache:     114748     140952
Swap:            0          0          0
GoNz0@Router:/tmp/home/root#

If I run "swapon /tmp/mnt/16GB/myswap.swp" after in putty it shows the swap working again!

*edit, rebooted and left it 10 mins, still no swap.
 
Last edited:
Great to hear swap is working.

That swap won't activate after a reboot sounds like my bad, I didn't realise that the post-mount script didn't exist yet. It needs to be properly formatted and start with a shebang. It should look like this (if you don't have other scripts like AB-Solution etc. installed).

Code:
#!/bin/sh

swapon /tmp/mnt/16GB/myswap.swp

Make sure that you edit the file with a text editor compatible with Unix LF, like Notepad++ which can be downloaded free. If not sure, go to Edit > EOL Conversion > Unix (LF) (this is in Notepad++) and save the file again.

It has to be executable as well. To make sure, do the following in a terminal on your router:

Code:
chmod 0755 /jffs/scripts/post-mount

That should do the trick. Now you can reboot and swap should be activated at boot.

Let me know how it works out.
 
Last edited by a moderator:
Hi M@rco, success!
I forgot all about adding a shebang as it's been a while since I did any tinkering.
Nearly thought it didn't work but the new post you put up missed a space but for a change I figured out what was wrong :cool:

Really appreciate the help from you and bigeyes0x0 to get me up and running.

Code:
GoNz0@Router:/tmp/home/root# free
             total       used       free     shared    buffers     cached
Mem:        255700     136324     119376          0       2336      14600
-/+ buffers/cache:     119388     136312
Swap:       524284          0     524284
 
Nearly thought it didn't work but the new post you put up missed a space but for a change I figured out what was wrong :cool:

Aaargh, it was before 7 AM I posted this... Space corrected and glad to hear it finally worked out!
 
Aaargh, it was before 7 AM I posted this... Space corrected and glad to hear it finally worked out!
Ha, I never got back to you last night as I woke up at 2am after nodding off on the settee, figured it best to leave it until I had been to bed :D

To those following, WinSCP's editor works fine creating new files in the router :)
 
I barely had my eyes open when I typed the instructions, so I'm actually glad it's just one space missing... :cool:

To those following, WinSCP's editor works fine creating new files in the router :)

And to those following who love Notepad++ (like yours truly), it can easily be set as the default text editor in WinSCP :D
 
I barely had my eyes open when I typed the instructions, so I'm actually glad it's just one space missing... :cool:



And to those following who love Notepad++ (like yours truly), it can easily be set as the default text editor in WinSCP :D
I didn't know that, I use both but being lazy used the built in one, not any more :D
 
Update/Reconfig:
Just run the installation script above again

Uninstall:
Just remove /jffs/dnscrypt directory and restart your router
@bigeyes0x0 could you add wording in post #1 for those that want to update from v1 to v2?
Is a complete removal of v1 necessary to update to v2 or can it simply be reinstalled?

Also, the uninstall procedure you give is incomplete. It leaves /jffs/scripts/dnsmasq.postconf, wan-start, init-start, services-stop and depending on selection, firewall-start with dead entries.

It would be best to include that in an auto-remover function. If you would add a comment to each entry such as this:
Code:
sed -i "s~^$COMMAND~[ -x $COMMAND ] \&\& $COMMAND $OP~ # added by dnscrypt installer" $TARG
then you can sed the line away easily.
Skynet already does and the upcoming AB4 will only add such one-liners to these scripts, with a comment who added it.
 
Not asuswrt related.
For people who are interested in getting dnscrypt-proxy v2 to work on android.

https://github.com/jedisct1/dnscrypt-proxy/wiki/building

** I am just forwarding it. I have not tried it. Try at your own risk.
There is a link at the end of the page for non-root android.
 
I can't seem to get dnscrypt-proxy to work at all on my RT-N66W, neither v1 nor v2. After the installation process and a reboot, my router can't connect to any server; all nslookup/ping queries or any other connection attempts fail.

Installation process shows 2 errors about files:
Code:
...
=>  Do you want to install dnscrypt-proxy to /jffs [y/n]: y
 Info:  Downloading manager
 Info:  Downloading nonroot
 Info:  Downloading dnscrypt-proxy-linux_mips-2.0.0.tar.gz
installer: eval: line 1: echo: Bad address
 Info:  Downloading public-resolvers.md
installer: eval: line 1: echo: Bad address
 Info:  Downloading public-resolvers.md.minisig
linux-mips/
linux-mips/dnscrypt-proxy
...

Also, when I try to run dnscrypt-proxy manually I get an "applet not found" error:
Code:
myusername@DEPO:/tmp/home/root# /jffs/dnscrypt/manager dnscrypt-start
killall: dnscrypt-proxy: no process killed
dnscrypt-proxy: applet not found

pidof dnscrypt-proxy also doesn't show any numbers after installation.
Leaving WAN DNS blank or using router's IP as a DNS doesn't work.
No OpenVPN server/client info entered on the router ever.
AB-Solution and YAMalwareBlock are the only 2 scripts installed and I never touch scripts folder.

I searched the forum but couldn't find a solution, yet. Any thoughts?

PS: I'm a noob on networking so please go easy on me

TIA
 
@underdose
Looks like something is wrong with the binary then. I can't do much with v1 anymore as that's legacy now. For version 2, if by running:
Code:
/jffs/dnscrypt/dnscrypt-proxy -config /jffs/dnscrypt/dnscrypt-proxy.toml
pidof dnscrypt-proxy
you don't see any number returned then it's a binary issue. You should report that to Frank, the original developer of dnscrypt-proxy, at https://github.com/jedisct1/dnscrypt-proxy/issues . You might want to open the file /jffs/dnscrypt/dnscrypt-proxy.toml and delete/comment out the line "daemonize = true" to see any other errors on your console instead of in WebUI System Log.
 
Last edited:
@people with MIPSEL router. I do believe it works before on some older versions as well so you need to be able to try the old versions out and tell Frank, maybe he can do something. You might want to read back on this thread as people did report it works before. Unfortunately, I only have an ARMv7 router so anything happens on MIPSEL or ARMv8 routers is unfortunately can only be tested and reported by you :(.
 
https://github.com/jedisct1/dnscryp....0.0/dnscrypt-proxy-linux_mipsle-2.0.0.tar.gz

^^ grabbed that one and it runs which is better than before!

admin@RT-N66U-F830:/jffs/dnscrypt# ./dnscrypt-proxy --config /jffs/dnscrypt/dnscrypt-proxy.toml

[2015-08-01 00:03:08] [NOTICE] Source [https://download.dnscrypt.info/resolvers-list/v2/public-resolvers.md] loaded
[2015-08-01 00:03:08] [NOTICE] dnscrypt-proxy 2.0.0
[2015-08-01 00:03:08] [FATAL] listen udp 127.0.0.1:65053: errno -9

Just wont bind, tried putting my actual IP in as well here. Any thoughts?
 
As said not a clue, please check back on this thread. I remember another ran it successfully on his MIPS router with dnscrypt-proxy beta at the time. Find that version, and try to run it. If successful go try newer versions, one by one, until you fail. Report the finding to Frank.
 
Looks like its my router upgrade purchase will be sooner rather than later! Frank just replied to the issue I raised in my previous post, looks like the kernel is too old on the RT-N66U

admin@RT-N66U-F830:/jffs/dnscrypt#
Linux RT-N66U-F830 2.6.22.19 #1 Sun Jan 28 01:08:15 EST 2018 mips ASUSWRT-Merlin
 
@dcguru Looks like your router is SOL, erh I meant EOL then. Not much I can do about this but as there's confirmation I will be disabling MIPS support in my script, unfortunately.

I'm also contemplating lately whether to upgrade my AC56U (as ASUS seem to stick it on 382 even though it practically has the same chip as the AC68U) to something like AC66U_B1 (enough for my household) or the AC86U but then Merlin still upgrade firmware for the AC56U, so it's still kicking.
 
@dcguru Looks like your router is SOL, erh I meant EOL then. Not much I can do about this but as there's confirmation I will be disabling MIPS support in my script, unfortunately.

I'm also contemplating lately whether to upgrade my AC56U (as ASUS seem to stick it on 382 even though it practically has the same chip as the AC68U) to something like AC66U_B1 (enough for my household) or the AC86U but then Merlin still upgrade firmware for the AC56U, so it's still kicking.

I agree SOL it is! Thanks for all your help over the last couple of weeks on this, appreciate you responding.

Agree, AC86U was on my radar/wishlist just want to be sure before I drop £200!
 

Similar 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!
Top