negan07 / ancistrus

Netgear's D7000 Nighthawk Router Experience Distributed Project
https://negan07.github.io/ancistrus/
GNU General Public License v2.0
66 stars 17 forks source link

Automate renew ip connection #76

Closed melidron closed 3 years ago

melidron commented 3 years ago

Hello from greece and merry Xmas Is there a way to make a working script or any other way so the D7000 renew the ip ? Is there any working method to make router renew its ip except manual way ? Thanks a lot

negan07 commented 3 years ago
rc wan adslmode|atmqos 
rc wan auto devid
rc wan start|stop|restart [wanid] 
rc wan up|down wanid

wanid is mostly 1

rc wan restart 1 should be the cmd even if not always the dhcp lease is also renewed: there is always the possibility to obtain the same ip again so some delay may help

rc wan stop 1
sleep 30
rc wan start 1

or

rc wan down 1
sleep 30
rc wan up 1

increasing delay if needed

Merry Christmas !

melidron commented 3 years ago

Hello again and thank u for your quick respont where do I paste all these commands? and what parts ? inside jdownloader ? or is it a batch? or something else? excuse my ignorance and thank u again my friend

negan07 commented 3 years ago

they are console command, usually used into telnet or ssh cmd line session

melidron commented 3 years ago

how can i use them on JDownloader? is it easy to explain more?

negan07 commented 3 years ago

the procedure to use console cmd is:

telnet 192.168.0.1 root pw

rc wan restart 1 exit (ctrl+D)

I don't know the automation procedures of the software, but if the router is recognized the easiest way is through cmd line

melidron commented 3 years ago

the reconection methods that JDownloader2 use in settings is !. External Batch Reconnect 2. External tool Reconnect 3. Liveheader,,, Can u tell me if there is a way to make a working batch with the commands u told me? what should I paste inside this Batch file? thank u again

negan07 commented 3 years ago

is the program able to client telnet ? or ssh ? if not you should call it from windows side then proceed from it

found also something useful https://jdownloader.org/news/blog/x20100125-102732router-reconnect

melidron commented 3 years ago

i have tried many times the method u have pasted and it can only disconnect router but never connect it again...the progmam does not offer a client telnet or ssh but if i knew how to make a batch file that open telnet DOS window and then connect to routter with admin and passworc then run the command u told me that would solve my problem...

negan07 commented 3 years ago

there isn't a properly "reconnect button" on web gui but "reboot" one so proceed manually inserting local router ip, user/pw then create a new script a macro operation record will start: enter the credential go to adv tab then router info then reboot (upleft) at the end save the script

melidron commented 3 years ago

yes there is reconnect button in advanced mode... but its not that the point... Anyway I managed to do what I wanted with vbs script where send key to run telnet and your amazing command yout wrote that renew my ip adress in only 16 - 21 seconds... Thanks a lot for your support And happy new year my friend :) :)

negan07 commented 3 years ago

happy new year too