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 automatize switching the DHCP and Static IP usage for a specified interface in win7?

I got AP connected to an other and when the other ap goes offline mine don't give to my PC IP address because DHCP is on the other AP, so I get 169.254.x.x address and cant reach my AP neither 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 192.168.0.10 255.255.255.0 192.168.0.1 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

 
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.