Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Is it possible to automate switching the DHCP and Static IP usage for a specified interface in Win7?

I have an AP connected to an other and when the other AP goes offline it does not give my PC an IP address because DHCP is on the other AP. I get 169.254.x.x address and can't reach my AP or the NAS connected to my AP. Any solution would be good except manually switching the interface's setting between DHCP and static.

share|improve this question

2 Answers 2

The simplest solution would be to always use a static IP address that's outside your first AP's DHCP range. From the sounds of it, there's no reason your computer needs to actually switch IP addresses (unless you've left something out.)

Other than that, you could write yourself a couple simple batch scripts to switch the settings.

For static IP:

netsh interface ip set address "Local Area Connection" static 1

(more info at http://support.microsoft.com/kb/257748)

And for DHCP:

netsh interface ip set address "Local Area Connection" dhcp

Copy those lines in to Notepad, Save As using .bat as the extension, drop them on your desktop, and run as necessary.

share|improve this answer

Simply right click on the network interface and then click Properties. Double click TCP/IP V4

Click the Alternate Configuration tab. Click User Configured radio button. Enter your desired static info here. Click OK

Now that interface will try DHCP and then use your user configured settings if DHCP fails or is not available

share|improve this answer

Your Answer


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.