Monday, October 11, 2010

Automated reboot of Netgear FVG318

I'm having trouble with some Netgear FVG318 wireless VPN routers. They can't seem to release their DHCP leases without a reboot, and there's no way to schedule a reboot on them.

Other than that, these are really great, reasonably priced little devices.

Hopefully my contacts with Netgear Support will yield a fix so that they don't run out of DHCP leases *for no reason*, but until then I need a workaround.

So, I used some wget magic to script logging in, saving the necessary cookies, and executing the reboot function.

Just replace your.fvg318.ip with your FVG318's IP, replace youradminpassword with your admin password. I doubt the line breaks will come out proper in blogspot, so I'll tell you that there is only one line of command between each comment line -- if it line wraps on here, you will need to make sure your copy that you run does not wrap those lines.

Then just set this up in a cron job to run every night at midnight and voila! No more unhappy uesrs, no more manual reboots.

#!/bin/sh

# Load login page
/usr/bin/wget --no-check-certificate -q -O - --save-cookies /tmp/netgear-cookies.txt --keep-session-cookies 'https://your.fvg318.ip/' > /dev/null

# Log in
/usr/bin/wget --no-check-certificate -q -O - --save-cookies /tmp/netgear-cookies.txt --load-cookies /tmp/netgear-cookies.txt --keep-session-cookies --referer='https://your.fvg318.ip/platform.cgi' --post-data='web0x120010=admin&web0x120011=youradminpassword&umi.loginAuth=Login' 'https://your.fvg318.ip/platform.cgi' > /dev/null

# Reboot
/usr/bin/wget --no-check-certificate -q -O - --save-cookies /tmp/netgear-cookies.txt --load-cookies /tmp/netgear-cookies.txt --keep-session-cookies --referer='https://your.fvg318.ip/diagnostics.htm' --post-data='umi.restartWrap.x=69&umi.restartWrap.y=14' 'https://your.fvg318.ip/platform.cgi' > /dev/null

3 comments:

Unknown said...

Wonderful!

One of mine freezes randomly:
Wi-Fi emits no signal and access to the administration interface is no longer possible

I own 4, and is the only connection that is configured PPPoE, watch this...

Thanks again for your script, and if anyone can make a Windows version, others might be interrested I think

Unknown said...
This comment has been removed by a blog administrator.
manishkumar said...
This comment has been removed by a blog administrator.