Reboot TP-Link router remotely or automatically

Standard

using cURL or wget, it’s easy to reboot a TP-Link router from a terminal or command line. Put it in a script and schedule it to run automatically if your router overheats or is flaky:

in OSX (using cURL):

curl --user username:password http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot > /dev/null

If you have wget by default instead of cURL (i.e. most *nix):

wget -qO- --user=username --password=password http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot > /dev/null

Replace username and password with the admin username and password of your router. Replace 192.168.1.1 with the IP address of your router.

If you have Windows, with neither of the above, and don’t want to download wget, try using bitsadmin to create a download job.

23 thoughts on “Reboot TP-Link router remotely or automatically

  1. I all the time used to study article in news papers but now as I am a user of
    internet therefore from now I am using net for content, thanks to web.

  2. nick

    Hi,
    is there any way to restore my backup configuration on TP LINK W8950ND by using script/CLI? I’m not familiar with scripting.

  3. Thomas

    Hello,
    I have tried the curl command on Mac OS X 10.9 and TP-Link TL-MR3020. With the Firmware version TL-MR3020_v1_130226 i have no problem. Then i made a Firmware update (TL-MR3020_V1_130929) and i get the Message “You have no authority to access this router!”. Back to Firmware TL-MR3020_v1_130226 and the command work again.

  4. Thomas

    I have fixed the Problem with the Firmware update (TL-MR3020_V1_130929). At the side from openWRT i have found the answer. Here is my solution:

    curl –user admin:admin –user-agent ‘Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:12.0) Gecko/20100101 Firefox/12.0′ –referer ‘http://192.168.0.254/userRpm/SysRebootRpm.htm’ http://192.168.0.254/userRpm/SysRebootRpm.htm?Reboot=Reboot

    If you have an other Port than 80 you must add :8888 (or something else) after the IP-Addresses.
    I have tested this with all Firmwareversions from TP-Link for the TL-MR3020.

  5. Nour Imam

    I was able to reboot the TL-5120 remotely using the curl command above, before the command was taking effect but now it is not working. I have tried the same command on TL-ER6120 using a Linux machine but still it is not taking effect.

    Can someone help me with issue?

    Thanks

  6. I come here baucase i know how to do, but my new TPLink is not accepting it. This may be about new models are using sightly modified htm files on their firm. I have solved it by myself watching code. I used cURL, but you can do the same using wGet for sure.

    Problem IS NOT the user. You can use at leat 3 syntax using curl for user AUTH:
    -u user:pass URL // shortcommand
    –user user:pass URL // longcommand
    user:pass@URL // obviously not working that example

    Using simple GET you may success with
    user:pass@URL but when you tried to use get directly it warns with the same messagen when you miss the passw. That’s the obscure thing here.

    I have inspect source htm code of reset router page and just found the trick; even if it’s a clear GET response, they have put into multipart/form-data like a post, wich is NOT.

    How to solve? I guest we can only do using cURL or wGET, never using plain url method(user:pass@URL). I got using cURL by doing the following:

    curl -L admin:admin@192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot –data “” –get > nul

    or

    curl -L -u admin:admin http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot –data “” –get > nul

    Explain -L: follow redirects. When you use IP, certain models will send you to a “faked” url wich is really your mapped ip router. Always use a -L is a time saver.

    Explain–data “”: By default, using –data=”myvalue=1″ will change cURL to POST mode, also set the “multipart/form-data” for data manipulation. We put empty values just to call form-data mode. POST is encoded while GET not.

    Now again, wtf?, because the form is using GET…
    Explain: –get: That forces the form to GET mode but still maintains “multipart/form-data”.

    Question? omg, are we using POST and GET at time? NO!
    You’ve activaded the url encode for the GET method by calling both. Once you call –get, POST feature from –data is avoided.

    I will made a better explanation of this on my blog, but not now… i spend my free time making a single bat line to reboot router.

    Thank you :)

  7. I am sorry, but my last message has no code wrappers… also text has changed from mine.

    curl -L -u admin:admin http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot --data “” --get > nul

    --data and --get params has to use two of -- not just one... Please admin edit if you can, and lelete that one.

    Regards.

  8. Please remove all my last comments.
    I have digging a lote more and now im not sure how i did, but is not what i explain.

    Srry :D i will come back asi i do and just need to know to reproduce again!.

  9. Digging and digging, finally you have the hole!

    Here is how it works, forgot my lasts comments. Just need to use same url as referer then will work again :D

    Using cURL:
    curl -L --user admin:admin http://192.168.1.1/userRpm/SysRebootRpm.htm?Reboot=Reboot --referer "http://192.168.1.1/userRpm/SysRebootRpm.htm/"

    Using wGet:
    wget --user=admin --password=admin --referer=http://192.168.1.100/userRpm/SysRebootRpm.htm http://192.168.1.100/userRpm/SysRebootRpm.htm?Reboot=Reboot 2>/dev/null 1>&2

    To avoid file creation, Linux user has to put 2>/dev/null 1>&2 at end of the line. Windows users can put > nul or just nothing.

    Regards.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>