[HELP]Script to auto-restart modem

Discussion in 'Tomato Firmware' started by arvin2212, Oct 2, 2009.

  1. arvin2212

    arvin2212 Addicted to LI Member

    Hey guys,

    Right now, my modem is connected to my WRT54GL's WAN PORT like usual. After adding a line to the wan up and firewall script area, i could access my modem from my computer. (Router ip = , Modem ip =

    However, sometimes my modem would drop off the connection and it would have to be restarted. This is not the problem with the modem as i've found out but rather the phone line. I tried calling for the technicians of my ISP for help, but they said there was nothing wrong with my uptime.:eek: When the modem drops off the connection, i could either restart it or remove the phone line that is connecting to it and reconnect it. That would usually solve the hangup issue.

    My question is, what script is needed so that the WRT54GL would ping a certain site every few minutes, and if the pings are not received, then it would automatically restart the modem. (Perhaps it could telnet into the modem and issue a reboot command?).
  2. TexasFlood

    TexasFlood Network Guru Member

    I remember a similar thread back a while. Take a look at this thread which also references this one.
  3. Planiwa

    Planiwa Network Guru Member

    I could write a script to do what you want, if I knew what modem you have, but I doubt that what you want is what you need.

    I would prefer properly diagnosing the actual problem.

    In my experience, the only time when it is necessary to reboot a modem to solve a connection problem is when the modem is stuck in a state where it would be unresponsive to attempts to telnet to it.

    Perhaps it will make more sense to try to find out what the actual problem is. :)
  4. arvin2212

    arvin2212 Addicted to LI Member

    My modem make is TPLINk TD-8816. There is nothing wrong with the modem. I've tried 3 other modems before this and this issue persists. The thing is, when the WAN connection is dropped, i couldn't access the internet and i couldn't dial in to my isp's server if it's set to bridge mode. The webpage and telnet for the modem works without any issues. Like i said in the post, i usually just restart the modem , but i found out that once the WAN connection is dropped, i don't have to actually restart the modem. All i have to do is to remove the RJ11 cable from the modem and reconnect it. And then i would be able to access the internet again.

    So it's better that the router would just sense once the WAN connection is dropped and send a command via telnet perhaps to force the modem to reboot in order to get back the ADSL link.
  5. TexasFlood

    TexasFlood Network Guru Member

    Seemingly I missed part of what you were trying to do.

    In my case, the scripts in the threads linked to above could reboot my cable modem instead of the router by replacing the reboot command with the below command which will reboot my Motorola Surfboard. Or, I could reboot the cable modem then the router, both if needed.

    Not sure if your modem has a similar capability.

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice