Windows 7 Forums
Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Keep static IP for each network?


25 Nov 2010   #1

Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
 
 
Keep static IP for each network?

Is there a way I can keep a different static IP for each network I connect to?

Like on my house, I wanted 192.168.1.200 (Which worked till I connected to a different internet)
And at my friends house, when it connects, it connects with 192.168.1.150.

and as I reconnect to whichever internet, it switches to that IP.

My System SpecsSystem Spec
.

25 Nov 2010   #2

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Yes, and it's quite easy to do. Routers and modems we normal users use to connect to Internet normally use IP addresses in series 10.0.X.X, 172.16.X.X or 192.168.X.X. So, for instance your router's IP i.e. your DHCP server address is most probably 192.168.1.1. If you now let's say visited me, you could not join my network keeping your old IP because my DHCP server address is 192.168.2.1

If you didn't have a static IP to connect to my router, it (DHCP server) would then assign you an IP address from my address pool, which I have limited to 99 addresses as this image shows:

Name:  LAN_1.png
Views: 5
Size:  24.5 KB

If you visited me often, we could for instance agree that you can always use 192.168.2.15 when here. You can set a static IP for every network you normally use as for instance I have set this laptop to have these two addresses (WiFi & LAN) when home here in Leipzig:

Name:  LAN_2.png
Views: 5
Size:  22.2 KB

When in our other home, other side of Germany, I have two other static IP's. I also have a static IP to use in my favourite pub; the owner is a friend and let's me use his fast gigabit office network so I don't have to use the slow public WLAN when sitting there with my laptop.

To create a connection for every network you regularly visit, open the Network and Sharing Center, click Connect to a network, and follow the instructions.

Keep static IP for each network?-lan_4.png

Go then to each connection's properties and set DHCP, DNS and IP info manually. Result is this:

Name:  LAN_5.PNG
Views: 16
Size:  89.6 KB

Kari


My System SpecsSystem Spec
25 Nov 2010   #3

Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
 
 

As Kari said, as long as the router you are connecting to is in the same subnet...

In a private use Class C IP address like the ones you describe are at home and your friends house. 192.168.1.0 is the subnet ID, and most home based routers use either 192.168.1.1 or 192.168.1.254 as their default IP's, and 192.168.1.255 is the broadcast ID for all of the IPs in that subnet. You should be fine setting your static IP on the lappy to say something in the range of 192.168.1.110-120. And connect to most networks fine as that is the most common out there!

If however one of the networks you wish to connect to with that NIC (network adapter) is anthing other than a 192.168.1.??? network you wont connect until you change the card back to a dynamic IP served up by the router or a static IP in that address range... 10.0.0.0 (class A private space)or a 172.16.x.x (class b private space) are typical other ranges used.

Hope that helps explain!
My System SpecsSystem Spec
.


25 Nov 2010   #4

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Just finished editing my previous post. This time I really noticed what can happen, how wrong info you can give, when reading the question wrong.

OK, my excuse is whisky Anyway, I first read the question to be if it would be possible always, everywhere use the same static IP. Posted a reply, and then noticed that I had the question completely wrong.

This rant is meant to be a public apology; if someone read my first reply, he / she could have got completely wrong idea.

Sorry. No more whisky tonight. Maybe one or two but no more...
My System SpecsSystem Spec
25 Nov 2010   #5

Windows 7 Ultimate 64bit
 
 

Not trying to steal the op's thread but it's relevant but is it possible to do something similar by creating a .bat file eg. "friends connection" which contains

netsh interface ip set address name="Wireless Connection" source=static addr=192.168.0.10 mask=255.255.255.0
netsh interface ip set address name="Wireless Connection" gateway=192.168.0.1 gwmetric=0
netsh interface ip set dns name="Wireless Connection" source=static addr=192.168.0.1


And another .bat file eg. "Home connection" which contains

netsh interface ip set address name="Wireless Connection" source=static addr=192.168.1.10 mask=255.255.255.0
netsh interface ip set address name="Wireless Connection" gateway=192.168.1.1 gwmetric=0
netsh interface ip set dns name="Wireless Connection" source=static addr=192.168.1.1


I haven't played with this but in theory it should work ?
My System SpecsSystem Spec
25 Nov 2010   #6

Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
 
 

Quote   Quote: Originally Posted by cclloyd9785 View Post
Is there a way I can keep a different static IP for each network I connect to?

Like on my house, I wanted 192.168.1.200 (Which worked till I connected to a different internet)
And at my friends house, when it connects, it connects with 192.168.1.150.

and as I reconnect to whichever internet, it switches to that IP.
His and his friends are on the same subnet... 192.168.1.x... a static IP in that space will work for both networks! Just set it to anything in between .2 and .253 and it should never need to be changed for most private routers.
My System SpecsSystem Spec
25 Nov 2010   #7

Windows 7 Ultimate 64bit
 
 

Hiya Darryl

Thanks for the reply, but like I said I didn't want to steal the op's thread, I was just wanting to know that if the 2 locations were on a different subnet would a bat file like I showed work.

soz for the confussion
My System SpecsSystem Spec
25 Nov 2010   #8

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Me too, I am sorry.

I tried to cover every possible DHCP and subnet, thus telling how to do it for every network which he visits separately. Of course if if it's only question of home and one other place and the subnet is the same, then it's enough to have just one static address.

I repeat my excuse: CEO of our household gave permission to leave the pills for one night and have some whisky...
My System SpecsSystem Spec
25 Nov 2010   #9

Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
 
 

Quote   Quote: Originally Posted by Kari View Post
Me too, I am sorry.

I tried to cover every possible DHCP and subnet, thus telling how to do it for every network which he visits separately. Of course if if it's only question of home and one other place and the subnet is the same, then it's enough to have just one static address.

I repeat my excuse: CEO of our household gave permission to leave the pills for one night and have some whisky...
TUI??? Typing Under the Influence??? LOL!
My System SpecsSystem Spec
25 Nov 2010   #10

Microsoft Community Contributor Award Recipient

Windows 8.1 Pro with Media Center
 
 

Darryl, don't tell other geeks here but it's not the first time...

Seriously, once or twice I have waked up with a really bad case of hangover, read what I'd posted the night before and then deleted almost everything from past 24 hours. Happens...
My System SpecsSystem Spec
Reply

 Keep static IP for each network?




Thread Tools




Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 05:55 AM.
Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App
  

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33