Скрипт на перезагрузку роутера

Обновлено: 06.07.2024

После непродолжительного исследования были найдены такие команды:

Разорвать VPN соединение:

Подключить VPN:

Перезагрузить роутер:

Но, как оказалось, управлять этими командами роутером напрямую не получается. Они работают только при авторизации в админке роутера через браузер и то только можно увидеть их выполнение с помощью firebug, а напрямую, при вводе в адресную строку работает только команды дисконнекта/коннекта VPN. Команды срабатывают, но при этом все равно выдается ошибка. Перезагрузить роутер таким образом не получается.

Мгновенно выскакивает «You have no authority to access this router!» и ничего не происходит.

Самое интересное, что так:

Перезагрузка из Linux

Меня больше интересовала перезагрузка из линукса, но такая команда не срабатывала:

К тому же, при помощи wget не удавалось даже выполнить Disconnect/Connect VPN.

Решение все же было найдено. Не вдаваясь в подробности скажу что роутер при GET запросе проверяет:

С этим всем отлично справляется команда curl.

Скрипт перезагрузки роутера
Итак, привожу скрипт перезагрузки роутера, который у меня получился:

Соответственно, скрипт реконнекта VPN:

Поставил в cron скрипт реконнекта при отсутствии пинга dns гугля — проверка каждые 3 минуты.
Скрипт перезагрузки проверяет наличие интернета каждые 15 минут.

login:pass, конечно, нужно будет поставить свои. Файлы скриптов назвать, например, tplink_reboot.sh и tplink_reconnect.sh, сохранить на сервере, дать права на выполнение и добавить в планировщик.

Уже пару раз выручило.
tplink_reconnect.zip
tplink_reboot.zip

Перезагрузка из Windows
Готовая сборка Wget + Bat скрипт для перезагрузки (только перегружает):
скачать tplink_reboot_wget.zip (подходит для большинства моделей Tplink, не только WR1042ND)

Перезагрузка из Android
(спасибо за этот код neolead)

Для андроид в данном изложении требуется root. Если нет рута.. то в конце checknet заменить на step1

у меня работает в машине как переподключение,затем перезагрузка wifi после трёх фейлов…

Разорвать VPN соединение:

Подключить VPN:

Перезагрузить роутер:

Но, как оказалось, управлять этими командами роутером напрямую не получается. Они работают только при авторизации в админке роутера через браузер и то только можно увидеть их выполнение с помощью firebug, а напрямую, при вводе в адресную строку работает только команды дисконнекта/коннекта VPN. Команды срабатывают, но при этом все равно выдается ошибка. Перезагрузить роутер таким образом не получается.

Самое интересное, что так:

Перезагрузка из Linux

Меня больше интересовала перезагрузка из линукса, но такая команда не срабатывала:

ошибка:

К тому же, при помощи wget не удавалось даже выполнить Disconnect/Connect VPN.

Решение все же было найдено. Не вдаваясь в подробности скажу что роутер при GET запросе проверяет:

Cookie для авторизации не используются.

С этим всем отлично справляется команда curl.

Скрипт перезагрузки роутера

Итак, привожу скрипт перезагрузки роутера, который у меня получился:

Соответственно, скрипт реконнекта VPN:

login:pass, конечно, нужно будет поставить свои. Файлы скриптов назвать, например, tplink_reboot.sh и tplink_reconnect.sh, сохранить на сервере, дать права на выполнение и добавить в планировщик.

Уже пару раз выручило:
tplink_reconnect.zip
tplink_reboot.zip

Перезагрузка из Windows

Готовая сборка Wget + Bat скрипт для перезагрузки (только перегружает):
скачать tplink_reboot_wget.zip (подходит для большинства моделей Tplink, не только WR1042ND)

Перезагрузка из Android

(спасибо за этот код neolead)

Для андроид в данном изложении требуется root. Если нет рута.. то в конце checknet заменить на step1

Скетч Arduino для плат на базе микроконтроллера ESP32

(спасибо за этот код p-a-h-a)

One thought on “ Скрипт удалённой перезагрузки WI-FI роутера TP-LINK TL-WR1042ND ”

Спасибо, очень интересная статья и полезная.

Что именно изменилось, что-то не работает?

попробуй сменить время во всей квартире и в роутере. если будет по новому времени перезагружаться значит провайдер не виноват!

Большое спасибо!
Работает и в случае с TL-WR841N.

спасибо. полезная инфа.

дак под виндоус то как запускать?
ну скачал, ну установил wget а дальше то что? что куда вводить чтобы заработало?

anatoly, wget работает в режиме командой строки. Т.е. для использования можно или написать .bat файл, или создать ярлык с параметрами.

как проверть работоспособность вгет?

c:\Program Files (x86)\GnuWin32\bin>wget.bat

Так же не работает, вот лог из cmd, помогите пожалуйста

Не совсем понятно куда эти скрипты ставить? Брать VDS?

Можете запускать со своего компьютера или локального сервера.

Добавил в конце статьи архив, содержащий готовую сборку Wget + bat скрипт автоматической перезагрузки.

Я имел в виду скрипт для перезагрузки роутера

Спасибо! Полезная статья

Здравствуйте. Скачал, распаковал, в Reboot Router указал логин и пароль (admin,admin), запускаю wget.exe от имени администратора, ничего не происходит. Windows 10, TD-W3151N. Роутер не подходящий? Или что-то не так делаю?

Запускать нужно Reboot Router, из него происходит вызов wget.exe с нужными параметрами.
Права админа в Windows для этого скрипта необязательны.

1. Задавайте Login и Password без кавычек.
set Login=admin
set Password=admin
2. Попробуйте варианты задачи IP:
set IP=192.168.1.1
или
set IP=192.168.0.1

у меня не работает
Запускаю, выдаёт это:

Но роутер не ребутится.

Заполните правильно(!) в файле Reboot Router.bat следующие переменные:
set IP=192.168.0.1
set Login=admin
set Password=admin

А можно глянуть скрипт проверки и перезагрузки по крону.
Спасибо.

Ссылки на архив с готовыми скриптами находятся в конце статьи.

Возможно, Вы в диспетчере задач (планировщике) не указали папку в которой лежат исполняемые файлы.

Не проходит перезагрузка в роутере mr3020. Операционная система: windows 7. Параметры настроены верно, т.е. и ip и логин с паролем. Но вот перезагрузки почему-то не происходит :(

На mr3020 скрипт не тестировался. Скорее всего, там совершенно другая админка с другими адресами ссылок на перезагрузку.

Просто роутер будет стоять у людей, скажем так, несколько далёких от техники :) Поэтому и ищу решение для перезагрузки скриптом.

Пока что откопал только Bash скрипт для линукса (ubuntu/debian). Хотя когда-то делал и для обычного bat/cmd через telnet без vbs скриптов.

expect - "
send -s "reboot\r"
expect -exact "The system shell is being reset. Please wait. "
exit
EOF

Укажите в планировщике рабочую папку, в которой лежит скрипт.

Спасибо !
Но, к сожалению, 5 минут меня не устраивают. Специфика работы требует не более одной.

Поставьте в планировщике сколько угодно. Будет каждую минуту проверять. Хотя, проблем может добавить т.к. модем не успеет перегрузиться за минуту и поднять соединение, а скрипт его повторно уже в ребут отправит.

Попробовал в планировщике привязаться к событию BROWSER код 8033. Интересно, что при отключении питания роутера сразу проходит команда на перезагрузку, а при отключении кабеля интернета планировщик не реагирует, несмотря на то, что событие в журнале появляется.

Ваш вопрос выходит за рамки данной темы.

Согласен, тем более, что проблему решил.

Спасибо автору за статью, реально помогла )) перерыл кучу сайтов ниче не найти или не работает (( а тут все гуд ..

Дай Бог вам здоровья! :)
Спасибо

Жорик, для данной модели роутера не существует альтернативных прошивок.

Для TPlink Archer C20 скрипт не работает. Wget из под Win ((

tl-mr3420 работает. Спасибо

Спасибо большое за подсказку !
я сделал (на основе Вашего) 2 скриптика один для проверки сети (каждые 3 минуты) а вторым в час ночи перезагружаю принудительно так как у билайна надо переподключаться чтобы трафик с 1-8 часов не считался .
До этого перезагружал китайский таймер .
работает на ноуте с linux для перезагрузки TP-Link MR-3420v2(3.16.9 Build 150116 Rel.40997n) + ZTE MF823

Если у вас есть роутер ASUS или другой с прошивкой от Олега, то эта записка для вас. Недавно у меня возникла трудность, которую никак не получалось решить. VPN-сессия зависала, при этом VPN-соединение оставалось подключено. Роутер не мог понять, что надо переподключится. Приходилось каждый раз вручную делать перезагрузку роутера, согласитесь, это долгий и утомительный процесс.

linux-code

Я покопался в интернете, оказалось я такой не один и проблема довольно масштабна среди “роутороводов”. Наши провайдеры не особо жалуют пользователей с роутерами, в большинстве случаев после ответа на вопрос “какая у вас операционная система” суппорт умолкает.

Я не задавался и продолжал искать, но нигде не было универсального решения данной проблемы. Тогда я подумал, мой роутер основан на Unix и поддерживает Bash-скрипты. Я решил написать “умный” скрипт перезагрузки, в случае повисания VPN-сессии. После нескольких проб и ошибок я остановился на таком варианте.

Алгоритм работы данного скрипта такой: Сначала мы посылаем 3 ping’a до Яндекса, если они проходят то выводим “internet ok”. Если нет, то посылаем ещё 3 ping’a до Гугла, если проходят, выводи “internet ok”. Если ping не дойдёт и до Гугла, то перезагрузка.

Этот скрипт необходимо добавить в планировщик задач (в большинстве случаев это cron), чтобы он выполнялся каждые 5-10 минут.

Качественные cайты на скриптах.

Старые комментарии:

Игорь 31.10.2010 18:37
Интересно, а как засунуть этот скрипт в роутер? :-?

Игорь 01.11.2010 13:48
Спасибо, получается, что роутер D-Link превращается в ASUS :eek:

Илья 01.11.2010 14:42
Ну.. Да :yehh2:

demeister 13.04.2011 04:26
скажите а на DD-WRT при прописании скрипта в cron он будет работать?

Илья 13.04.2011 15:15
Да должен, ибо тоже Linux :yehh2:

Олег 07.09.2014 17:27
Доброго времени суток! Скажите пожалуйста, а можно таким способом перезагружать другую точку, коротая подключена к моей мостом?

Комментарии

It is by Wes Gordon and we love how simple and flattering the lower is, in addition to how putting the yellow
floral print is. And even worse for anyone eager to put money
into a Wes Gordon costume, the designer is taking a break from his namesake line while he consults at Carolina Herrera, so there isn't any current assortment.
It hails from the Resort '14 assortment so has sadly now sold out.
Former Wimbledon champion McEnroe, now an in-demand
tennis commentator, mentioned on the BBC this week that Djokovic
has 'off-court issues with the household'. Djokovic and wife Jelena married in 2014
and are expecting their second little one.

Woods had the issues along with his spouse after which he
seemed to go utterly off the rails and has never been even near being the identical participant.
Pictures of Novak Djokovic together with his arm round Serena and Venus
Williams' beautiful chef have emerged amid claims the tennis champion is having marital issues with wife Jelena.

Several the fact that I had been playing for a few months at
the time, my doubts about the legitimacy of this game had persisted from the first,
and then they remained unabated. The fact that I had
won and made a bet on their losing implied that I
foretold them to lose, which they did not do usually.
Upon receiving the first payment, it was processed in less as opposed to 20 hours, and the second payment was processed during 48 hours
after receiving the first payment. Sorry getting late; please accept
my sincere apologies for any annoyance this may have caused you.

This website should nevertheless be visited by everyone who gambles,
and I highly order it to all of you who do.

Asking questions are actually pleasant thing if you are not understanding anything totally, but this post gives pleasant understanding even.

Do you have a spam issue on this website; I also am
a blogger, and I was wanting to know your situation; many of us have created some nice procedures and we are looking to exchange solutions with other folks, why not shoot me an email if
interested.

Thank you, I've recently been looking for info about this subject for a
long time and yours is the greatest I've discovered till now.
But, what concerning the bottom line? Are you certain about the source?

Hey I know this is off topic but I was wondering if you knew of any
widgets I could add to my blog that automatically tweet my newest twitter updates.
I've been looking for a plug-in like this for quite some time and was hoping maybe you would have some experience
with something like this. Please let me know if you run into anything.
I truly enjoy reading your blog and I look forward to your new updates.

It's awesome for me to have a web site, which
is helpful designed for my know-how. thanks admin

Gov. John Carney, a Democrat, placed a $ten bet
on the Philadelphia Phillies to beat the Chicago
Cubs on that day, and he won, Delawareonline. com reported.

10.00. There are a lot of advantages of having stay stats however on the days like a soccer action-crammed
Sunday when the reside stats are not available, one can get extraordinarily annoyed.
Follow together with the most recent live updates, including the latest
score and stats from the game in addition to video highlights and extra provided above.
There are literally thousands of Worldwide Tv Channels; you could have access to greater than 3500 HD channels
worldwide instantly by yourself Pc. Have you ever stared on the synopsis of Watch Monday Night Football Online?
Football shirts by branded firms sometimes
supply sale throughout the football season thus giving you
an opportunity to grab the branded shirt at an inexpensive value.
For many who would like something slightly quieter,
Indianapolis has many museums to supply. The city is full of present retailers as well
as distinctive shopping experiences that supply many various souvenirs.
From the traditions of yore to all new fun attractions, this city has quite a lot
happening. Kansas City Chiefs a member of the National Football League and situated in Kansas
City, Missouri. Others complained concerning the drive for brand spanking new
exhibits like the Squad Football Pod, a programme that includes
‘fans, social media stars, podcasters and absolutely no former players’ over conventional
sports activities coverage.

Greetings, I do believe your blog could possibly be having internet browser compatibility issues.
Whenever I look at your site in Safari, it looks fine but when opening in Internet Explorer,
it's got some overlapping issues. I simply wanted to
give you a quick heads up! Other than that, wonderful
website!

"The softer fad in this months real estate data will certainly not prevent the MPC from elevating passion prices tomorrow as the economy remains to show solid development with price pressures continuing to be a concern," the Rics expert
included. Pompeo called Huawei "an arm of the CCP's security state that enables and also censors political dissidents mass internment camps immigration lawyers in devon - Phil: http://businesspeopleclub.com/index.php?qa=user&qa_1=touchgrip5 - Xinjiang as well as the indentured servitude of its populace."
Any providers worldwide that use Huawei's devices "are doing company with civils rights abusers," Pompeo
added. Huawei was blacklisted by the United States in Might 2019 when it was included in the nation's "entity checklist" (PDF).
Huawei has repetitively refuted that charge.
Huawei didn't quickly reply to a request for remark.
The Trump management has revealed United States visa limitations
on Huawei employees such as the refusal or cancellation of
a visa. Last month, the Trump management announced its finding that Huawei is backed by the
Chinese military. The Pentagon sent out a paper to Congress including the names of 20 Chinese companies that it located to be backed by the People's Freedom
Military, consisting of Huawei. Trump at the very same time authorized
an exec order basically outlawing the firm in light of nationwide safety issues that Huawei had close ties with the Chinese federal government.

I do consider all the ideas you've introduced on your post.

They are very convincing and will certainly work.
Still, the posts are too brief for starters.
May you please extend them a bit from next time?
Thanks for the post.

These markets are great for bettors who think a crew might
win however there’s also a chance of a draw.
That’s because we automatically rank them on our best bets,
so the video games at the top are all the time the games that we think have essentially the most value betting
on. 1. Some individuals like to have their football
events at dwelling in front of the large display. We break down what
Parlay betting is all about in relation to Football and how and why
you could wish to do it on DraftKings Sportsbook or your
favorite on-line sportsbook. We spoke about the process being
ruined by 1 outcome already, but this is without doubt one of the explanation why this just doesn’t
work as a system. Soccer Betting Odds: Soccer betting is just like hockey and baseball, being that you simply pick a workforce to easily win the sport.
The money line is a key part of soccer betting. Data from over 4000
recent affiliation soccer (soccer) matches from the principle English competitions present clear evidence
that the rate of scoring goals adjustments over
the course of a match. When taking a look at an NFL soccer line, keep in mind
that the minus-signal (-) all the time signifies a favourite.

Hello! Do you use Twitter? I'd like to follow you if that would be ok.

I'm absolutely enjoying your blog and look
forward to new updates.

It's genuinely very difficult in this active life to listen news on Television, therefore I only use the web for that reason, and get the latest news.

The talent to instate an online casino on a smartphone makes the gaming process more easy and does not unite the better to a stationary computer, and remarkable PC programs get ready for a secure Internet connection. Gamblers are gleeful to make use of such software to access gambling diversion, so operators present oneself them functioning applications instead of smartphones and PCs. On this time we have collected the a-one casino apps as a replacement for Android with a real boodle game.
Many operators put forward without cost or obligation download of online casinos proper for Android [url font-size:0;padding:0;margin:0;"> in-onewin-1win. pp.ua"]1win UA for genuine filthy lucre with withdrawal to electronic wallets or bank cards. Ambulant casinos are being developed in compensation the convenience of customers and attracting a larger audience. Such applications include a swarm of undeniable advantages:

Access to the casino from anywhere where there is Wi-Fi or unstationary Internet. At the unchanging ease, applications do not fasten on up much lacuna in the thingamajig's memory.
The functionality corresponds to the desktop rendition of the resource: you can arouse bonuses, participate in tournaments, crammed your account, fake opening machines in search bread in the effort with the withdrawal of winnings, etc.
End-to-end registration. There is no requirement to additionally archives from your phone if you acquire an active account.
For free demos. Gamblers can float any video opening or board dissimulate in a free grief mode.
The simply fly in the ointment of the version adapted object of lightweight devices may be the lack of some titles in the presented collection. The movable appeal of an online casino with niche machines seeking playing for money gives access solely to slots in HTML5 aspect, but so further not all providers be enduring redesigned their portfolios in accordance with this requirement. Degree, the largest manufacturers have been producing niche machines since distinct years engaging into account additional standards and remaking old titles instead of them, which are especially trendy among gamblers.

Not only that, providers hire into account the features of transportable devices when creating games. A gala interface and bosom modes of make use of are being developed in return them. Looking for model, Wazdan offers a aspect that increases the battery economy of the device by way of 40%, and Ultra Lite technology, which preserves the counterpart quality and download speed with a deliberate Internet connection. Opening machines on the phone bear simply a start button and a gamble au courant with control.

The gaming interface on a matter-of-fact box is marginally modified compared to the desktop manifestation, so it is quite at one's fingertips to put on in the casino appositeness for spondulicks from your phone, oversee slots and groove machines. The main menu is esoteric in drop-down windows, and links to the paramount sections are habitual at the cut off or bottom of the screen. Also, the online converse appeal to c visit cancel button an eye to contacting applied living expenses specialists is unceasingly in sight.

Since the Google Revelry and AppStore digital dispersal services impose tough restrictions on gambling programs, you can download the casino perseverance to your phone as regards playing real money from the proper website. To download, you require need a together to the apk systematize and the consumer's acquiescence to settle and sprint the program. Every once in a while operators advise precise ordination instructions on the chapter with a link, and if there are difficulties, the patron can always consult with the buyer service.

Some licensed casinos also forth clients programs for personal computers and laptops. You can Casino Apk them from the valid website. Such software is popular due to unwavering uninterrupted access to games from the desktop without using a browser.

Если при регистрации в Сообществе Вы укажете адрес электронный почты, который используете на данном форуме, то Ваши данные будут перенесены на форум Сообщества автоматически.
Также, если на форуме Сообщества Ваш никнейм будет занят, то Вам предложат сменить его или оставить, но с приставкой "_RU".

Убедительная просьба не дублировать темы на старом/новом форуме.

Скрипт для автоматической перезагрузки роутера

Беспроводной гигабитный маршрутизатор серии N со скоростью передачи данных до 300 Мбит/с
Правила форума
Правила форума TP-LINK lll ЧАВО lll Первичная настройка WAN роутера lll Настройка под провайдеров lll Официальные прошивки и драйверы lll

Скрипт для автоматической перезагрузки роутера

Аппаратная версия устройства : v1 00000000
Версия прошивки : 3.15.3 Build 130705 Rel.55616n
Ваша страна : Украина
Название провайдера : LDS
Тип подключения : PPPoE
Скорость по тарифу : 10
Подключение с ПК по wifi или по кабелю? : PK

Нужна перезагрузка командой, не вручную

2013-10-12 11:14:30 (66.0 MB/s) - `SysRebootRpm.htm.1' saved [2590]

забавно это
как теперь это сделать скриптом в Linux?
с помощью wget пока не получилось
wget "http://login:pass@192.168.0.1/userRpm/StatusRpm.htm?Connect=Connect&wan=1"
не работает

Ответа не будет? Это же официальный форум TP-LINK?
В 1042 подключение консолью отсутствует, перегрузить по-другому нельзя, а очень нужно.
Что теперь из-за этого роутер на помойку? salp писал(а): Ответа не будет? Это же официальный форум TP-LINK?
В 1042 подключение консолью отсутствует, перегрузить по-другому нельзя, а очень нужно.
Что теперь из-за этого роутер на помойку? абырвалг2 писал(а): посмотреть запрос get на перезагрузку TL-WDR4300 v1.3 @ 3.13.33 Build 130617 [Радиаторы на чипах CPU/Switch]
TL-WA901ND v2.2 @ 3.12.16 Build 120224
TL-R480T v2.0 @ 3.7.1 Build 091203
ISP/WAN: IPoE (Dynamic IP) @ 1 Gbit/s (40 Мbit/s Internet)

Пробовал, мгновенно выскакивает "You have no authority to access this router!" и ничего не происходит.

Пробовал, мгновенно выскакивает "You have no authority to access this router!" и ничего не происходит.

Читайте также: