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
cclloyd9785

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
Kari

Microsoft Community Contributor Award Recipient

 

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: 6
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: 6
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.

-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: 17
Size:  89.6 KB

Kari


My System SpecsSystem Spec
25 Nov 2010   #3
Darryl Licht

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
Kari

Microsoft Community Contributor Award Recipient

 

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
PooMan UK

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
Darryl Licht

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
PooMan UK

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
Kari

Microsoft Community Contributor Award Recipient

 

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
Darryl Licht

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
Kari

Microsoft Community Contributor Award Recipient

 

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





Similar help and support threads
Thread Forum
Win 7 Pro 32 won't see network, won't honor static IPv4
I'm posting this at a couple of Windows networking forums. We set up three new terminals this week at the office; they're all running Win 7 Pro 32-bit. I set them all up simultaneously (literally sat at a desk and entered the same keystrokes at each of them), so I don't see any obvious reason...
Network & Sharing
Static IP Changes To Public Network
WIN7 SP1, Comcast Cable (internet only), Motorola gateway, Ethernet Cable, Onboard Realtek LAN, IPv6 disabled. My IP address of 192.xxx keeps changing to 169.254.52.105 and to public network. I tried manually setting IP in v4 properties but that doesn't work nor does modem refresh or ipconfig...
Network & Sharing
Can't connect to any network without Static IP
Hello All, I have problem with my windows: I can't connect to any network without Static IP can anyone help me? Thank you
Network & Sharing
Static IP Settings for just one network connection?
According to my understanding, when i go to the network settings and tell it to use specified IP and DNS settings instead of using Automatically Assigned IPs, it sets that standard for ALL the wireless connections stored on my computer, and all the networks start using those IP settings. Is it...
Network & Sharing
Static IP blocks network sharing
I have been searching to find a solution to this problem and I have found a lot people with similar problems but no solution. Dynamic IP everything works. Three different routers D-Link, Zyxel and Planet tested. Four PC's on the network including Mac-Leopard Static IP everything works...
Network & Sharing
How can you create both a static and dynamic network?
I am trying to create both a static and dynamic network for my computer to choose from when I connect my notebook to one of two locations. I want to create a LAN 1 which picks up the static info specific and an LAN 2 for my dynamic connection. This is possible to do with operating systems such as...
Network & Sharing

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 04:54.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App