1

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.

LonnieBest
  • 1,450
  • 4
  • 21
  • 36

1 Answers1

4

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.

  • Might work better to put this in a batch file and then run the batch file. – Michael Hampton Jun 02 '13 at 05: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 02 '13 at 09:07