Keep static IP for each network?

Page 1 of 3 123 LastLast

  1. Posts : 662
    Windows 7 Home Premium x64, Mac OS X 10.6.2 x64
       #1

    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 Computer


  2. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #2

    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:

    Keep static IP for each network?-lan_1.png

    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:

    Keep static IP for each network?-lan_2.png

    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:

    Keep static IP for each network?-lan_5.png

    Kari
    Last edited by Kari; 25 Nov 2010 at 19:38. Reason: Explained in my next post ;)
      My Computer


  3. Posts : 1,939
    Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
       #3

    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 Computer


  4. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #4

    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 Computer


  5. Posts : 2,726
    Windows 7 Ultimate 64bit
       #5

    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 Computer


  6. Posts : 1,939
    Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
       #6

    cclloyd9785 said:
    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 Computer


  7. Posts : 2,726
    Windows 7 Ultimate 64bit
       #7

    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 Computer


  8. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #8

    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 Computer


  9. Posts : 1,939
    Windows 7 Ultimate 64 bit Steve Ballmer Signature Edition
       #9

    Kari said:
    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 Computer


  10. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #10

    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 Computer


 
Page 1 of 3 123 LastLast

  Related Discussions
Our Sites
Site Links
About 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 12:28.
Find Us