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.

In Windows XP, you could do this. That method does not work in Windows 7; anyone know of a workaround?

For everyone that will be asking why I would want to do this:

On this network we have two IP subnets: 192.168.0.0/24 and 172.19.8.0/24. One is DHCP with internet access and the other is static. Currently I need either to change my IP configuration everytime I need to Google something, then change it back (pain in the ass). Get a DHCP address then statically configure that same address along with the other static address (dangerous to do on DHCP).

It is a little strange; but the 172.19.8.0/24 subnet contains embedded devices that need to be configured how they will be in the field.

share|improve this question
add comment

migrated from serverfault.com Aug 5 '10 at 18:53

This question came from our site for professional system and network administrators.

2 Answers

The solution would be to get an dhcp reservation put in place for your computer so that you do not need to use dhcp and then you can use the two ip addresses at the same time.

Is there some reason this is not possible?

The alternative, as you have noted is to convert your dhcp ip address to static. (It is possible to create a batch file that reads the current settings and calls netsh to add the same settings as a static address and then you can add the second ip address)

This isn't recommended but it will work under certain conditions. For example, if you switch your computer off every day and your dchp server gives leases for longer than a day (and I think the default for windows servers is eight days), then that address is effectively yours (and safe to use) for the whole day. However you should change your network settings back to dhcp before you logoff, so that your lease is renewed when you restart. (There used to be Microsoft Knowledge base article that showed a way of running a batch when logging off which may or may not still work)

Even if you start your computer without first setting your network to DCHP, this will still be ok providing the server thinks the ip address you are using is still yours, which it will do unless your lease is up. You could get into ip conflicts if your machine crashes and then you leave it off for nine days, so the dchp server gives your ip address to someone else and then you start up and attempt the use the same address.

share|improve this answer
add comment

What a strange setup.

I don't think it can be done without a second NIC.

Having said that, you could make this easier by creating two batch files. The first one would do something like:

netsh interface ip set address name=”Local Area Connection” dhcp

when you want to surf the internet. The second one would do something like:

netsh interface ip set address name=”Local Area Connection” static 172.19.8.10 255.255.255.0 172.19.8.1

when you need your static.

Create the two diff batch files and just double-click them on your desktop when you need them.

share|improve this answer
    
Nice, that does make it much easier. But not having them both at the same time is annoying. I think dual IP static is easier for now. For other cases, I will definitely be using this to fill in for windows' lack of a ability to save IP settings profiles. –  Nick Whaley Aug 5 '10 at 14:28
add comment

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.