Search code examples
vb.netwireless

how to restart a personal wireless netgear router with vb.net?


How do configure an netgear wireless router in vb.net code? I want to restart my router and thought about disconnecting clients. This might be used to help a relative with their wireless router.

Edit: OS Information: Windows 7 SP1 .NET Framework 4.5 or above


Solution

  • First-off: you should never have to reboot your router under any circumstances (short of a firmware upgrade). If your modem/router "breaks" occasionally and requires a reboot to resume normal operation then something is wrong with it and you should seek a warranty replacement. A line de-sync should not require a reboot either.

    With that disclaimer out of the way: there are two ways you can achieve your goal:

    The first is to use the Telnet administration features present in your Netgear router (assuming they're enabled and operational). Writing a Telnet-client in code is trivial and an exercise left to the reader. It's just a matter of knowing the right commands to send to get it to reboot.

    The second is to write a web client (using HttpWebRequest) that sends the series of HTTP requests to the router in the same way a human-directed-browser would if they were doing the reboot themselves. Use a tool like Firefox's "Live HTTP Headers" to see what HTTP requests need to be sent. Be wary of problems with cookie retention in HttpWebRequest.