Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I'm remotely accessing a network where I'm testing two separate dhcp servers where:

1) Both dhcp servers are on the same subnet.
2) The dhcp servers do not have overlapping ip pools.
3) Each dhcp server has its own static ip address. 

My testing will require me to do the following numerous times:

1) Turn off dhcp service 1 on server 1, which currently has several leases
2) Turn on dhcp service 2 on server 2
3) Remotely login to a workstation and 
   a) release current dhcp lease
   b) obtain new lease from active dhcp service
4) Repeat these steps several times (going back and forth between dhcp services).

So far, I've only killed one workstation :) with this command:

ipconfig /release && ipconfig /renew

Before that, I also tried just doing:

ipconfig /renew

But, instead of renewing with the currently active dhcp server, it instead complained that it couldn't reach the previous dhcp server at its ip address (where I've turned off dhcp).

If I were physically on-site, I could unplug the network cable and then plug it back in, and therefore consume the active dhcp server (I've just turned on), but I'm working remotely and do not know a command that's equivalent to reseating the connection.

By the way, it is off hours at this company, so there is no concern for users losing connectivity. I'm just trying to avoid travelling on-site to perform these tests.

Please advise.

share|improve this question

1 Answer 1

I think you can just disable and then re-enable the interface on your test workstation:

 netsh interface set interface name="Local Area Connection" admin=disabled && netsh interface set interface name="Local Area Connection" admin=enabled

WARNING: You should test this on a workstation you have physical access to before trying it on a remote workstation where your only administrative access to it depends on that interface.

share|improve this answer
    
Might work better to put this in a batch file and then run the batch file. –  Michael Hampton Jun 2 '13 at 5:27
1  
Even better: Put both commands in a batch-file and run this as a non-interactive scheduled tasks 2 or 3 minutes after "now". Then logout from the system. See "at /?" for doing this from a commandline. –  Tonny Jun 2 '13 at 9:07

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.