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.

I am a developer. I need to have a static IP adress when I'm at my office, and would like to use my DHCP at home.

Making a reservation on the office's DHCP isn't possible (the router they have doesn't allow that).

I've looked up through Google to see if there is something that could suit my needs but haven't found any (Maybe it's because I don't know the name of the technology I'm looking for).

So my question is: Is there a way to automaticly switch from a static address to a dynamic depending on the network?

share|improve this question
    
If you're a developer, why don't you write your own command to detect it when Windows logs in? –  Dave Rook Aug 27 '13 at 7:48
add comment

1 Answer

You must change IP manually or by a batch script. You can also write a program that changes IP depend on network

netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1 1

netsh interface ip set address "Local Area Connection" dhcp
share|improve this answer
    
All you need to do is have the script ran when at login time, easily achieved via task scheduler. I removed the "No" from your answer. + 1 –  Dave Rook Aug 27 '13 at 7:38
    
A startup script is good but not everyone shuts down/logs off their computer when going home, so maybe sometimes the IP doesn't change correctly, in that case maybe running the script manually is needed. But the best solution is that he writes his own IP changing program –  Lưu Vĩnh Phúc Aug 27 '13 at 8:43
    
But you can fire it at log on (or start up as you point out), even on a workstation un-lock! :) –  Dave Rook Aug 27 '13 at 8:51
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.