1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
Dismiss Notice

Welcome To SNBForums

SNBForums is a community for anyone who wants to learn about or discuss the latest in wireless routers, network storage and the ins and outs of building and maintaining a small network.

If you'd like to post a question, simply register and have at it!

While you're at it, please check out SmallNetBuilder for product reviews and our famous Router Charts, Ranker and plenty more!

[Release] dnscrypt installer for asuswrt

Discussion in 'Asuswrt-Merlin' started by bigeyes0x0, Dec 3, 2016.

Tags:
  1. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    551
    Thanks, I had no post mount so I created it and edited the permissions to match the others.

    before reboot

    Code:
    [email protected]:/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
    [email protected]:/tmp/home/root# mkswap /tmp/mnt/16GB/myswap.swp
    Setting up swapspace version 1, size = 536866816 bytes
    UUID=2e4ceeee-b7cc-4e9a-851d-75133e468ee3
    [email protected]:/tmp/home/root# swapon /tmp/mnt/16GB/myswap.swp
    [email protected]:/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
    [email protected]:/tmp/home/root#
    
    After reboot :(

    Code:
    [email protected]:/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
    [email protected]:/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: Feb 7, 2018
  2. Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!
  3. M@rco

    [email protected] Senior Member

    Joined:
    Dec 23, 2017
    Messages:
    286
    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: Feb 8, 2018
    GoNz0 likes this.
  4. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    551
    Hi [email protected], 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:
    [email protected]:/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
    
     
    [email protected] likes this.
  5. M@rco

    [email protected] Senior Member

    Joined:
    Dec 23, 2017
    Messages:
    286
    Aaargh, it was before 7 AM I posted this... Space corrected and glad to hear it finally worked out!
     
  6. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    551
    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 :)
     
    [email protected] likes this.
  7. M@rco

    [email protected] Senior Member

    Joined:
    Dec 23, 2017
    Messages:
    286
    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
     
  8. GoNz0

    GoNz0 Very Senior Member

    Joined:
    Jul 14, 2013
    Messages:
    551
    I didn't know that, I use both but being lazy used the built in one, not any more :D
     
  9. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,199
    Location:
    Switzerland
    @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.
     
    8thphloor and steelskinz like this.
  10. DonnyJohnny

    DonnyJohnny Senior Member

    Joined:
    Dec 17, 2017
    Messages:
    493
    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.
     
    popxunga likes this.
  11. bigeyes0x0

    bigeyes0x0 Senior Member

    Joined:
    Sep 9, 2015
    Messages:
    216
    8thphloor and thelonelycoder like this.
  12. thelonelycoder

    thelonelycoder Part of the Furniture

    Joined:
    Jan 23, 2014
    Messages:
    4,199
    Location:
    Switzerland
    Small copy/paste error:
    yesno_query "Do you want to uninstall dnscrypt-proxy to /jffs" uninst_dnscrypt "menu"
     
  13. underdose

    underdose Occasional Visitor

    Joined:
    Dec 13, 2017
    Messages:
    21
    Location:
    Istanbul
    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:
    [email protected]:/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
     
  14. bigeyes0x0

    bigeyes0x0 Senior Member

    Joined:
    Sep 9, 2015
    Messages:
    216
    @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: Feb 10, 2018
    underdose likes this.
  15. dcguru

    dcguru Occasional Visitor

    Joined:
    Aug 29, 2017
    Messages:
    10
    underdose likes this.
  16. bigeyes0x0

    bigeyes0x0 Senior Member

    Joined:
    Sep 9, 2015
    Messages:
    216
    @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 :(.
     
  17. dcguru

    dcguru Occasional Visitor

    Joined:
    Aug 29, 2017
    Messages:
    10
    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!

    [email protected]:/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?
     
  18. bigeyes0x0

    bigeyes0x0 Senior Member

    Joined:
    Sep 9, 2015
    Messages:
    216
    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.
     
  19. dcguru

    dcguru Occasional Visitor

    Joined:
    Aug 29, 2017
    Messages:
    10
    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

    [email protected]:/jffs/dnscrypt#
    Linux RT-N66U-F830 2.6.22.19 #1 Sun Jan 28 01:08:15 EST 2018 mips ASUSWRT-Merlin
     
  20. bigeyes0x0

    bigeyes0x0 Senior Member

    Joined:
    Sep 9, 2015
    Messages:
    216
    @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.
     
  21. dcguru

    dcguru Occasional Visitor

    Joined:
    Aug 29, 2017
    Messages:
    10
    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!
     
Please support SNBForums! Just click on this link before you buy something from Amazon and we'll get a small commission on anything you buy. Thanks!