Question

How can I simulate rebooting my router within Windows Vista?

Asked by: lhutton

When I reboot my router, I am assigned a new dynamic IP address. Rather than manually switching my router off and on, how can I simulate rebooting my router within Windows Vista?

I've tried ipconfig, as below, using a batch file run with administrator privileges, but I am not assigned a new dynamic IP address.

ipconfig /release
ipconfig /flushdns
ipconfig /renew

                                  
1:
2:
3:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-08-20 at 20:22:25ID24670307
Topics

Network Routers

,

Windows Vista

,

Dynamic Host Configuration Protocol (DHCP)

Participating Experts
2
Points
100
Comments
17

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. simulation
    What are the principles of computer network simulation in C?
  2. Keystroke simulation
    How can I (if I can...) simulate keyboard action(s) adressed to main Windows manager(WHICH ? i don't now) ? In 16-bit DOS I could send something to a keyboard buffer, in Windows 3.x send a message to Program Menager. It concerns Windows and MS-DOS programs intercommunication....
  3. Simulation
    Can i get Hard disk drive simulation software. for example fdisk simulation .
  4. Simulate Enter key
    Hi, I need to simulate pressing an Enter/Return key in batch script. Does anybody know how to do this? Thanks, Payal
  5. Cisco Firewall Simulator
    Cisco Firewall Simulator I wonder if there is any software similar to Boson but destined to Firewall training instead of Router and Switches. I used Boson for practicing on Router and switches but I am not sure if it has a version for Firewall practice. any idea? Tx

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: ecsrdPosted on 2009-08-20 at 20:34:47ID: 25148958

You won't be assigned a new IP since the router already associates your MAC address to one that was already in its database recently (before the timeout).  As long as the address cache is not flushed on the router you'll get the same address back.  HOWEVER, what you CAN do to force a different IP is to change your IP to a static address and then back to DHCP - what this will do (if the DHCP address is not in use and is part of the scope your router assigns) is cause the router to issue you the IP that you had assigned statically via DHCP.

The way DHCP servers work for handing out IPs is like this:

Normal operation:
New client requests an IP
Lowest available IP in the scope is assigned to the client
Client lease expires
client requests a new lease
same previously leased address is reassigned

Contention Mitigation - new IP lease:
Client leases an IP after being previously assigned a static IP in the same range as the DHCP scope
DHCP issues the same IP if already not in use

Contention Mitigation - early lease renewal:
Client releases its existing IP address and requests a new address
DHCP issues the same address if available that the client previously retained to prevent the DHCP scope from issuing all available IPs to one client.

I hope this helps.

 

by: ddiazpPosted on 2009-08-20 at 20:38:49ID: 25148974

Are you talking about dynamic local IP address or dynamic external IP address?

If you are talking about an address like 192.168.1.3 address (local address) the commands you mentioned should work. If you don't get a different one is because the router assigns addresses in ascending order, and if you release the address, if the router doesn't have any lower IP addresses, it will assign the same address. The router will delete the lease as the PC tells the router to release that IP address and basically it tells the router "I'm done with this IP, you can have it back".

If you are talking about an address like 69.14.66.10 (public) you must either reboot the router, or re-start its interface (if its a router like a cisco router that you can go into its interface and do -shutdown- and then -no shutdown-. For this though, nothing you can do from Windows.

 

by: lhuttonPosted on 2009-08-20 at 21:02:29ID: 25149069

To clarify, what I'm wanting to do is automate, presumably through a batch file, the process of switching my router off and on to be assigned a new external dynamic IP address.

 

by: ddiazpPosted on 2009-08-20 at 21:07:31ID: 25149083

What router do you have?

 

by: lhuttonPosted on 2009-08-20 at 21:15:01ID: 25149103

 

by: ddiazpPosted on 2009-08-20 at 21:51:22ID: 25149207

Could you try to enable local management telnet:

http://www.dynalink.co.nz/cms/uploads/file/Products/Rta1025w/Usermanual.pdf  (page 118)

and try to telnet into it.

Once you telnet into it, tell me the process of rebooting the router (probably have to navigate through a menu by selecting choices with numbers) If you can give me a sequence of numbers you must press to reboot the router, I can make a small script that will telnet into the router and reboot it.

 

by: lhuttonPosted on 2009-08-20 at 23:30:26ID: 25149491

I've managed to telnet inyo the router, entering my login, but am not sure what to do next.

 

by: ddiazpPosted on 2009-08-21 at 04:11:44ID: 25150556

Do you see output from the router or a command line interface of some sort? If you can telnet into it then you can most likely reboot it from there.

Can you telnet, press enter a few times and post a screenshot of what u see?

 

by: lhuttonPosted on 2009-08-21 at 11:43:22ID: 25154579

I enter my login, then it just sits at:

> _

 

by: ddiazpPosted on 2009-08-21 at 17:17:55ID: 25156875

Try typing things like 'help', 'menu', '?' (without the quotes)

 

by: lhuttonPosted on 2009-08-21 at 17:48:49ID: 25156951

Aha! 'help" and '?' work. I get a list of commands, one of which is 'reboot'.

 

by: ddiazpPosted on 2009-08-21 at 18:01:40ID: 25157002

Ok, looks like we gotta get our hands dirty now!

I'll try to come up with a script to reboot it.

 

by: ddiazpPosted on 2009-08-21 at 19:56:05ID: 25157226

Ok, I got this going on.


After you type 'reboot'. Does it ask you for confirmation if you really want to reboot?


My script telnets into the router, logs in and sends the reboot command. If the router doesn't ask for confirmation then it's done, if it does, then we need to add that part.


Since batch scripting cannot interact with telnet, I used   AutoIt   which is very simple to understand.

To run, you must download AutoIt, paste the following into the autoit editor, edit the values so it applies to your router (username, password and router IP) and go to File>Save As and save as an .exe. After this, you can run the executable and the router will reboot.


Run("cmd.exe")    ;opens the command prompt to start telnet
Sleep(300)        ;waits 300 milliseconds to issue the next command
Send("telnet 192.168.1.1")       ;issues the command to request a telnet connection to the router
Send("{ENTER}")                  ;Sends the command entered in the line above
Send("admin")                 ;Username to log in with
Send("{ENTER}")               ;Sends the username
Send("password")              ;PWD to log in with
Send("{ENTER}")               ;Send the pwd
Send("reboot")               ;Issue Reboot command
Send("{ENTER}")                ;Send Reboot command

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:

Select allOpen in new window

 

by: lhuttonPosted on 2009-08-21 at 21:30:57ID: 25157391

Got it working after adding a couple more sleeps; fantastic!

Thanks for your help.

 

by: lhuttonPosted on 2009-08-21 at 23:28:12ID: 25157593

After a few "plays" with this, I seem to have disabled telnet, as I'm now getting:

"Could not open connection to the host, on port 23: Connect failed"

I tried disabling Windows Firewall, but no luck; can you think what might be causing this?

 

by: lhuttonPosted on 2009-08-22 at 01:49:20ID: 25157951

OK, I seem to have sorted this out now: I disabled remote access to the router via telnet, and left local access enabled.

 

by: ddiazpPosted on 2009-08-22 at 06:26:35ID: 25158616

Yes, leave
local acces telnet nabled, and save your changes on the router so thy when it reboots it doesn't lose it's configuration

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...