Tuesday, September 11, 2012

How to easily reconnect ANY dd-wrt based router

For all of you who have a dd-wrt powered router, here is a very easy way to reconnect your router within seconds.

I found procedure explained below on JDownloader official forum once, but I never managed to find it again, so all credits go to the original contributor. But, I did modify it a bit to make it a bit easier to understand so I hope you'll give me some credits for it too.

OK, so here is what you'll need to do to make reconnect work on your dd-wrt router:

  • Get your self PuTTY, plink and PuTTYgen from http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html 
  • Use PuTTYgen to gernerate yourself a private / public key pair and save them
  • Open PuTTY.exe and create a new session named "router"
  • Set the Loginname to root (Connection->Data), Identity private key file (Connection->SSH->Auth), and the router's IP address (Connection)
  • Save the session
  • Now open a browser and go to the router admin page -> select Services tab
  • Activate secure shell
  • Disable secure shells password login
  • Paste the content of public key into the Authorized Keys field (from field "Public key for pasting into OpenSSH authorized_keys file")
  • Press "Apply Settings" button on the bottom of the page
  • Create a new bat file reconnect.bat (you can create it in any folder, but I find it handy to be in the same folder as JDownloader is installed) and paste the following code:
           plink.exe -load router stopservice wan
           plink.exe -load router startservice wan
  • After you've completed all the steps above, open JDownloader go Settings -> Reconnect
  • Choose External as reconnect method and set it to the reconnect.bat you've created before (make sure you choose the right folder where your reconnect.bat is located)
And that's almost all of it. Now you just need to take care of few more details to make sure the whole thing will work flawlessly.

  • Before you actually invoke reconnect.bat from JDownloader, make sure you manually start reconnect.bat because plink.exe will for sure need a certain interaction from you befor you use it for the first time (signature related). If you use your computer on more than one dd-wrt powered router, you'll need to repeat this step each time you switch to another router. Also this is a point where you'll easily discover if your firewall is (potentially) blocking plink.exe (you'll need to allow plink.exe if you want this method to work for you).
  • If you get error saying "Disconnected: no supported authentication methods available", this means you haven't typed in your public key in the right way in router config. So if a PuTTY Public key looks like (when you edit it with ie. Notepad):
          ---- BEGIN SSH2 PUBLIC KEY ----
          Comment: "rsa-key-YYYMMDD"
          yourgeneratedkeycontentgoesheresothisisjustimaginarysetofcharacters
          ---- END SSH2 PUBLIC KEY ----
  • You shouldn't copy/paste that, rather you need to run puttygen.exe and load your PuTTY Private Key.ppk (or whaterer filename you've saved your key to), afterwards you'll see a field named "Public key for pasting into OpenSSH authorized_keys file" containing text which will look something like this (regarding to above key example):
          ssh-rsa
          yourgeneratedkeycontentgoesheresothisisjustimaginarysetofcharacters rsa-key-YYYYMMDD

  • Select all of the text displayed in form named "Public key for pasting into OpenSSH authorized_keys file" and paste it into your router's config.
  • Press "Apply Settings" and you're ready to go!
Now you're all set up to try reconnecting your dd-wrt powered router from JDownloader. If you're looking for an alternative/additional way of reconnecting your modem/router, make sure you read this post. Described method will enable you to reconnect your modem/router even if you have a static IP address!

PS.
If you want to add an extra anonymity and security layer to your DD-WRT enabled router be sure to check out this post.

If you found this post to be useful please consider encouraging me to keep up the good work. You can easily do it by signing up with Copy.com cloud storage provider. Just click here and you will get 15GB + 5GB for following my link absolutely FREE. This way I'll get 5GB too.

No comments:

Post a Comment