Assigning static IP address

Discussion in 'Windows 8 Networking' started by busster8, Mar 26, 2013.

  1. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    I use my Lenovo twist for work. From time to time I have to assign a static IP address to my network card based on the customer premise. What I have found is that if I do a ipconfig from the command line, these static ip addresses are not released.
    If I assign ip1, then customer site ip2, customer site ip3, all three ip addresses will show up doing an ipconfig from the command line. From time to time, this also plays havoc with my wireless network card.
    The only way I have been able to resolve the issue is to remove the device(s) and reboot.
    Upon reboot, both devices are back to dhcp and normal.
     
  2. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    I am not the network aware poster on this forum, but I was wondering what process you are using to set the IP addresses?

    Have you looked into using Powershell to change the addresses and possibly there would be a way to script the actions you need?

    I know you can start the Powershell Admin window by using Winkey and typing Powershell then CTRL+Shift+Enter. Or you could just attach it to the Taskbar or Start. I have found some references to changing IP Addresses using Powershell and will give you one that might be a good place to start.

    Someone else on the forum might be able to give you an efficient way to do what you need.

    How to Change Your IP Address Using PowerShell
     
  3. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    I have just been going through the control panel to change IP settings.
     
  4. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    I haven't tried this either, but could you set up 3 or 4 network connections in the Network Connections panel? It appears, each name would have different configurations so you could enable or disable the ones you needed?
     
  5. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    But the "name" of my network adapter is always "local area network". I just open control panel > Network > right click on "local area network" > Properties > ipv4 and set a static IP address. I didn't even know the ip addresses were "sticking" until I plugged into a clients network, thinking I was DHCP to get a IP conflict message. Doing a ipconfig from the command line let me know I the adapter still had about 4 ip addresses from previous customer sites.
     
  6. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,455
    Likes Received:
    268
    Static assigned IP addresses are not allocated on a "lease" basis as are DHCP allocations - they are assigned manually and remain so until "released" manually. You can do this from a command prompt using the ipconfig command. Once released setting DHCP allocation will allow the adapter to obtain a new address automatically. The release command may or may not be optionally supplied with further parameters - this basic from will release all IP addresses from all adapters

    ipconfig /release

    To release the address from a specific adapter you can add the name of the adapter, eg:

    ipconfig /release Local Area Connection 1

    You may also use "wildcards" to release a group of addresses, eg:


    ipconfig /release Local*

    will release addresses from all adapters starting with the word local.
     
    #6 patcooke, Mar 27, 2013
    Last edited by a moderator: Mar 27, 2013
  7. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    I understand all of the above. ipconfig /release has no effect. Reboots, both warm or cold have no effect. The only way I have found to clear the old ip addresses is to remove the device and reboot. Upon reboot, the device is back and in dhcp mode.
     
  8. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,455
    Likes Received:
    268
    Just to check - you have tried executing a release for specific named adapters as well as for all?
     
  9. patcooke

    patcooke Microsoft MVP
    Staff Member Premium Supporter Microsoft MVP

    Joined:
    May 16, 2010
    Messages:
    5,455
    Likes Received:
    268
    Just realised, we have not mentioned setting the "obtain an IP address automatically" on the adapter properties - it this a case of missing the obvious - have you in fact done that to go from static to dhcp?
     
  10. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    Yes, you can change from static to dhcp. The adapter will get an ip address from the server. When you do an ipconfig, you will see the acquired ip address, AND the static ip addresses still listed. If you go to another site, get another ip address via dhcp, you will see the newly assigned ip address, the old ip assigned via dhcp is gone, but any staticly assigned ip addresses remain. The only way to remove them is to remove the device and reboot. DHCP assigned ip addresses work as expected. Only statically assigned ip addresses are troublesome.
     
  11. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    I'm not sure why this seems to be happening to you but you should be able to add, remove and or edit any IP address assigned to your NIC by using the advanced button -> IP Settings tab, in the properties of IPv4 within the properties of your Network Interface Card.
    WinLogo Key + R and type
    ncpa.cpl
    hit enter
    Select then right click your NIC (usually "Local Area Connection") and choose properties.
    In the box / frame labeled "This connection uses the following items:" scroll as needed and select "Internet Protocol Version 4 (TCP/IPv4)" and click the properties button.
    On the resultant dialog box click the "Advanced" button and under the IP Settings tab you should find any and all stored IP addresses for that particular NIC.
    Any NIC can have and actually use multiple IP addresses as well as Gateways if you're very clever at writing complex route tables. Otherwise it's best to stick with a single address per interface. We used to play with this a lot when studying for RRaS.
    Anyway you should be able to clean things up without removing the device and rebooting. If not there may be a more complicated underlying issue which might need a bigger hammer.
    You may want to look into rebuilding the IP stack
    and or the Winsock Catalog
    Regards
    Randy
     
  12. Saltgrass

    Saltgrass Excellent Member
    Microsoft Community Contributor

    Joined:
    Oct 16, 2009
    Messages:
    15,157
    Likes Received:
    393
    Randy, could the Alternate Configuration tab also be used to set up a static configuration. Then just select Private IP address, or User configured? Sometimes I find it useful to disable and then re-enable the Network adapter to resync.

    I don't know how many configurations the OP might need, but these options might make it a little easier.

    I took from the first post he has to assign a Static IP Addresse, for whatever reason. Hopefully that was a correct assumption.

    I am also a little confused when he mentions the Static IP address continues to show in ipconfig with DHCP in place. Perhaps he is reading the wireless adapter also?

    Edit: I found the following link, which seems to say if the computer cannot find a DHCP server on another network, it will automatically switch to the Alternate configuration.

    http://technet.microsoft.com/en-us/library/cc779231%28v=ws.10%29.aspx
     
    #12 Saltgrass, Mar 27, 2013
    Last edited by a moderator: Mar 27, 2013
  13. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    I am guessing you are correct. When he walks into a particular environment (client's office or whatever) he for some reason is unable to receive proper IP addressing from whatever is present on the network providing DHCP. So as a work around he determines what the proper schema should be and assigns it manually as static values.
    I have tried over and over again to duplicate his issues and have been unable to preserve any historic IP addressing data, excepting when I use the method I described above for assigning multiple IP address to the same interface.

    The only issues with using the Alternate Tab resolution is;
    1. If you have a static ip address assigned then the alternate tab is no longer available. So he would have to leave it as DHCP to begin with.
    2. Some people have informed me that because of APIPA the NIC will always resolve to something in the 169.254.xxx.xxx range and as a result will sometime maybe even often not failover to the Alternate Tab settings.

    I don't know as I seldom if ever use DHCP anymore. I guess I could experiment. If it works it might be a reasonably good approach, although it would likely still involve his having to adjust that addressing scheme to fit the alternate environment..
     
  14. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    OK, tested.
    Disabled my other NIC.
    Set the primary to DHCP and used the Alternate Tab to manually assign proper static values for my network.
    Disabled DHCP on my Router and rebooted.
    Initially it came up as "Identifying" took a minute or two and then decided that it was an "Unidentified" "Public Network" APIPA address 169.254.xxx.xxx and no default gateway.
    Then after another minute or two it automatically went through a second round of "Identifying" and after about a minute it failed over to the IP addressing scheme that I had configured under the alternate tab.
    Same thing happened after a second reboot.
    So as an option, it's viable if you are patient enough.
    Regards
    Randy
     
  15. busster8

    busster8 Active Member

    Joined:
    Mar 26, 2013
    Messages:
    6
    Likes Received:
    0
    As a technician working on specifically Avaya phone equipment, you often have to assign a specific static ip address to your PC in order to connect to the equipment. i.e. 192.11.13.5 / 255.255.255.252 and connect to 192.168.13.6. You have no choice, these are the ip addresses. Alternately, if you work on Avaya IP office, you have to assign an IP address in the 192.168.42.x range. Direct connection to the equipment without any sort of dhcp service, you have no choice but to manually assign. Once ANY ip address is statically assigned, removal and reboot is the only way to remove the IP.

    I am familiar with setting multiple ip addresses and gateways through the GUI, but usually, once you change your network settings to DHCP, static ip addresses/gateways are gone. From what I see, gateways are gone, but the ip addresses stay.
     
  16. Trouble

    Trouble Noob Whisperer

    Joined:
    Nov 30, 2009
    Messages:
    13,845
    Likes Received:
    833
    Are you per chance using any third party software to configure or otherwise manage these particular network connections that might be causing the interface ip addressing to persist?
    I cannot manage to create nor duplicate your problem, but......
    If I am understanding you correctly, you are saying that a single interface has multiple and persistent IP addresses that you have configured over time and they will not go away unless you remove the card and reboot.
    So..... all information regarding the IP addressing of all interfaces is contained in the registry here.....HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces
    If you are reasonably comfortable taking a peek under the hood, you'll notice (depending on the number of interfaces) a couple sub-keys under that location. Select each in turn until you see the one you are looking for. It should be reasonably evident as the data value for "IPAdress" will contain multiple IP addresses if my understanding of what you have explained is accurate.

    You can edit this information simply by double clicking the "IPAdress" data value and editing as you wish. You should be able to remove any extraneous IP addresses as well as alter the one you are working with to reflect the value you wish. Not exactly an ideal solution I know, but it should save you a removal and a reboot.
    NOTE: This has real time impact on your interface and does not require a reboot to take effect.
    And my boiler plate registry editor warning:
     
  17. plirr

    plirr New Member

    Joined:
    Dec 3, 2013
    Messages:
    1
    Likes Received:
    0
    I'm seeing this same problem, on a Dell Inspiron 15R with a Realtek NIC on Windows 8 and 8.1. Had it mostly stable changing IPs in 8 using netsh commands, but after fresh install and update to 8.1 problem has resumed. I change IPs very regularly as field tech for and ISP, when it corrupts with multiple IPs it often doesn't connect to the network even like it would if it was set up for multihoming. Further sympton is that even after static is set, the control panel shows DHCP, and can't be set to DHCP without netsh or powershell.
     
  18. Chris Edwards

    Chris Edwards New Member

    Joined:
    Jan 30, 2014
    Messages:
    1
    Likes Received:
    0
    I've experienced this as well. Namely with a Lenovo USB Ethernet 2.0 adapter. I can remove the ip's using:

    netsh int ipv4 delete address name="Ethernet 3" addr=192.168.2.5

    replace name and addr with the excess entries.

    This is not an ideal solution as it still continues to keep the old ip addresses once you add more.

    I haven't gone through this yet, but I think there might be some help here: http://social.technet.microsoft.com/Forums/en-US/8acb7cd1-7028-4ffe-86c9-eb43041cf8b3/how-do-i-get-rid-of-second-169254xx-ipv4-address-on-windows-server-2008-sp2-x86?forum=winservergen

    I'm also wondering whether any vm software is causing this? Do any of you have vmware player / workstation installed?
     
  19. spaded21

    spaded21 New Member

    Joined:
    Jun 25, 2014
    Messages:
    1
    Likes Received:
    0
    I am having pretty much the exact same issue on an Asus S400CA laptop. It just started happening randomly, as I have been on 8.1 for 6 months+. When I set a static and go back into the IPv4 properties, it shows that it's on DHCP. If I hit ok it does switch over to DHCP, but ipconfig shows the old IP address and gateway. Did anyone ever find a solution for this?
     

Share This Page

Loading...