I used to do the same thing: Connect to the wireless router, log in, navigate to the "Status -> Router" Linksys WRT54G web page, and click on DHCP Release and DHCP Renew buttons one after the other.

But I found that I can actually do the same process by just going to the command prompt and then type "ipconfig/registerdns" and the router connects and disconnects for me. What it actually does is refresh all DHCP leases and re-registers DNS names.

After discovering that it does the same thing, I wanted to automate this process by creating a batch file with the command "ipconfig/registerdns" and named it dhcp.bat. I then added a Scheduled Task to let this batch file run every 15 minutes.





Wilson wrote:

Script to disconnect Linksys WRT54G wireless router on Windows
19-Nov-07

Is there an existing wireless router linksys WRT54G script out there that
will run from Windows XP and hit the 'connect' & 'disconnect' button?

For example, I'd like to disconnect my wireless router (firmware 1.02.0) by
clicking on a single shortcut to replace the multiple button presses today.

That shortcut would (perhaps using wget or some other idea):
1. Connect to the wireless router IP address (https://192.168.0.1)
2. Log in with a blank username & enter 'letmein' as the password
3. Navigate to the "Status -> Router" Linksys WRT54G web page
4. Press the "Login Status = Disconnect" button

A similar shortcut would reconnect on demand.

Is "wget" the best way to accomplish this?

I can't believe I'm the first person to need this so some kind wireless guy
must have done this already. I googled for "linksys wrt54g connect script"
and found something called "slackware" in addition to "wget" but I'm not a
programmer so I would like to start with an existing script that does
SOMETHING like hit any button on the Linksys WRT54G router. Once I have
that, I can probably modify that program to do what I want.

I did find http://www.seattlewireless.net/index.cgi/LinksysWrt54g
interesting but I did not understand most of the detail (I have a lot to
learn).

Does anyone have a script that runs on windows that will connect to
https://192.168.x.y to then hit a button on the Linksys WRT54G router?

Previous Posts In This Thread:

On Monday, November 19, 2007 12:15 PM
Wilson wrote:

Script to disconnect Linksys WRT54G wireless router on Windows
Is there an existing wireless router linksys WRT54G script out there that
will run from Windows XP and hit the 'connect' & 'disconnect' button?

For example, I'd like to disconnect my wireless router (firmware 1.02.0) by
clicking on a single shortcut to replace the multiple button presses today.

That shortcut would (perhaps using wget or some other idea):
1. Connect to the wireless router IP address (https://192.168.0.1)
2. Log in with a blank username & enter 'letmein' as the password
3. Navigate to the "Status -> Router" Linksys WRT54G web page
4. Press the "Login Status = Disconnect" button

A similar shortcut would reconnect on demand.

Is "wget" the best way to accomplish this?

I can't believe I'm the first person to need this so some kind wireless guy
must have done this already. I googled for "linksys wrt54g connect script"
and found something called "slackware" in addition to "wget" but I'm not a
programmer so I would like to start with an existing script that does
SOMETHING like hit any button on the Linksys WRT54G router. Once I have
that, I can probably modify that program to do what I want.

I did find http://www.seattlewireless.net/index.cgi/LinksysWrt54g
interesting but I did not understand most of the detail (I have a lot to
learn).

Does anyone have a script that runs on windows that will connect to
https://192.168.x.y to then hit a button on the Linksys WRT54G router?

On Monday, November 19, 2007 12:41 PM
Jack \(MVP-Networking\). wrote:

HiRouters are propriety devices there is No one universal way to control them.
Hi
Routers are propriety devices there is No one universal way to control them.
As a result you cab expect Windows as an OS to be programmed to control
every Independent 3rd party device.
If it really important you can learn simple scripting, or pay some one to do
it.
If you just want to disconnect a computer from the Router you can use the
IPCONFOG /release command.
http://www.ezlan.net/iprel.html
Jack (MVP-Networking).

"Wilson" <davewilson69@sbcglobal.net> wrote in message
newswj0j.46096$eY.45009@newssvr13.news.prodigy.net...

On Monday, November 19, 2007 1:01 PM
Jeff Liebermann wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
Wilson <davewilson69@sbcglobal.net> hath wroth:


Sure. There are several Windoze "automation" tools. The one I like
to use is the ancient "Macro Recorder" from Windoze 3.1. However, I'm
not going to recommend this because of its age.

More modern incantations can be found at:
<http://www.kratronic.com/recorder/> ($23)
<http://www.aldostools.com/macro.html>
<http://www.jitbit.com/macrorecorder.aspx>
and so on. Search Google for "macro recorder" or "keystroke mouse
recorder". Lots to choose from.

You start the recorder, do whatever it takes with your mouse and
keyboard, stop the recorder when done, and save the macro. If you
want to repeat it again, just run the macro. Simple.

Another way to do this is to install DD-WRT or OpenWRT on your WRT54G,
and use various shell or expect scripts to turn the router on and off.
The command to turn on/off the WAN connection could be:
ifconfig eth1 up
ifconfig eth1 down
or something like that.



--
Jeff Liebermann jeffl@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

On Tuesday, November 20, 2007 12:57 PM
Wilson wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
On Mon, 19 Nov 2007 12:41:48 -0500, Jack (MVP-Networking). wrote:

Hi Jack,
I want to disconnect the router from the isp (not the pc from the router).
I dug some more and have some perl scripts (whatever perl is) and will see
if they will run on Windows.

Apparently they need to know the name of the Linksys WRT54G button. I
viewed the page source at https://192.168.1.0/StaRouter.htm and I think
that the button is called "connect" and then "disconnect".

I'll keep digging and asking questions and posting the answers as I find
them until we have a Linksys WRT54G script that runs from Windows to
a) Log into the Linksys WRT54G router
b) Navigate to the https://10.2.18.20/StaRouter.htm page
c) Press the disconnect button
d) Wait five or ten seconds
e) Press the connect button

This refreshes with a new IP address.

On Tuesday, November 20, 2007 1:01 PM
Wilson wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
On Mon, 19 Nov 2007 10:01:16 -0800, Jeff Liebermann wrote:

Hi Jeff,
I know from googling that you are a God on this here newsgroup so I
appreciate your help even if I'm not quite sure how to install "DD-WRT".

I'll look it up and hopfully post an answer so the next guy can press a
button to log into the Linksys WRT54G router, navigate to the status router
page, press the disconnect button, wait five seconds, press the connect
button.

This will automatically get a new IP address (at least in my setup it does
when I do this manually).

On Tuesday, November 20, 2007 1:44 PM
Wilson wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
On Mon, 19 Nov 2007 10:01:16 -0800, Jeff Liebermann wrote:

Hi Jeff,
Do you think this perl script modified to hit the disconnect & connect
button will work? I'm googling for just how I would change the script
below.

So far, I see the following changes needed:
1. I will google to see how to give the "null" set (blank?) as a login
2. I need to figure out how to press the disconnect button

Before I dig further, is this script below a good place to start in order
to create a Windows script that disconnects the Linksys WRT54G wireless
router from the ISP from a wireless portable PC client?

Wilson

use strict;


my $adr='https://192.168.0.1/Services.asp'; # talk to this
my $user='root';
my $pass='letmein';

use LWP::UserAgent;
my $ua = LWP::UserAgent->new;

my $req = HTTP::Request->new(POST => $adr,
['action','reboot']);

$req->authorization_basic($user, $pass);

my $result = $ua->request($req);


print $result->as_string;

On Wednesday, November 21, 2007 12:45 PM
Jeff Liebermann wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
Wilson <davewilson69@sbcglobal.net> hath wroth:


How to install DD-WRT:
<http://www.dd-wrt.com/wiki/index.php/Installation>
Note that there are different firmware images and proceedures for the
various WRT54G hardware versions. You didn't specify yours. Check
the serial number label.


I believe I suggested a method using a "macro recorder".


Maybe. Most ISP's don't work that way. If you disconnect, the next
time you reconnect, you'll probably get the same IP address. That's
to keep their log files sane. Notable exceptions are the ISP's that
change IP addresses to discourage setting up servers.

I question why you would need to change IP's? If this is some
variation on trying to become anonymous or hidden while on the
internet, you're on your own.

I'm not a Perl programmer, so I can't help you learn Perl via usenet.

--
Jeff Liebermann jeffl@cruzio.com
150 Felker St #D http://www.LearnByDestroying.com
Santa Cruz CA 95060 http://802.11junk.com
Skype: JeffLiebermann AE6KS 831-336-2558

On Thursday, November 22, 2007 7:57 PM
DTC wrote:

Re: Script to disconnect Linksys WRT54G wireless router on Windows
Wilson wrote:

Pathologically Eclectic Rubbish Lister


Submitted via EggHeadCafe - Software Developer Portal of Choice
BizTalk: Parallel Processing with Correlation
http://www.eggheadcafe.com/tutorials...rrelation.aspx