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 would like to have it so that my computer sets its IP address statically depending on which network that it is connected to. I have 3 Networks that I regularly use and it seems that with Windows I can only set a static IP for each interface. I am aware of DHCP tables, but unfortunately one of the routers crashes every time I even open the DHCP table list. I use Linux and Android on a regular basis, and they let you do this. For some reason with Windows I can't seem to figure out how. Am I missing something or is there some software I can install which will handle this for me?


In the related questions, I found this: Unique IP address settings (static/dhcp) per wireless network?

So this question is probably considered a duplicate, but It only gives you 6 free connections, after that you have to pay 20 euros for the full version. I would prefer a free solution though or a way to do it natively in windows. Something as simple as this should be free.

share|improve this question

migrated from serverfault.com Sep 10 '13 at 21:06

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

    
Do you have access to the dhcpd.conf (config file) on each network? If you had access you could tell the DHCP server if you encounter MAC address 12:34:56:78:9a:bc (whatever) give it this IP address. Each dhcp server on the 3 networks would have a different entry for the same MAC address. The DHCP server would then always hand out the same IP for that MAC address no matter what OS it was running. Does this work for you? –  cybernard Sep 11 '13 at 2:36
add comment

1 Answer

Suggesting an alternative


You can use a batch file to re-configure your interface with required settings and just have the settings you want pre-defined

All you need to do is setup the variables and for each network and then open the batch files and go

Interface example:

Batch interface

Code:

@echo off
cls
echo option 1: Network 1
echo option 2: Network 2
echo option 3: Network 3
choice /c 123 /m "Please select an option above: "

SET option=%ERRORLEVEL%
IF %option% == 1 goto n1
IF %option% == 2 goto n2
IF %option% == 3 goto n3
exit

:n1
netsh interface ip set address name="Local Area Connection" static 192.168.0.100 255.255.255.0 192.168.0.1
netsh interface ip set dns "Local Area Connection" static 8.8.8.8
netsh interface ip add dns "Local Area Connection" 8.8.4.4 INDEX=2
echo Completed
pause
exit

:n2
netsh interface ip set address name="Local Area Connection" static 192.168.1.100 255.255.255.0 192.168.1.1
netsh interface ip set dns "Local Area Connection" static 8.8.8.8
netsh interface ip add dns "Local Area Connection" 8.8.4.4 INDEX=2
echo Completed
pause
exit

:n3
netsh interface ip set address name="Local Area Connection" static 10.28.46.100 255.0.0.0 10.0.0.1
netsh interface ip set dns "Local Area Connection" static 8.8.8.8
netsh interface ip add dns "Local Area Connection" 8.8.4.4 INDEX=2
echo Completed
pause
exit
share|improve this answer
1  
I want it to be automatic. –  WalterM Sep 10 '13 at 22:07
1  
I've prefaced the answer with "Suggesting an alternative" if no suitable answer you have a fall-back. also remember community help "Keep an open mind The answer to your question may not always be the one you wanted" –  50-3 Sep 10 '13 at 22:14
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.