MacLochlainns Weblog

Michael McLaughlin’s Technical Blog

Site Admin

Windows 7 Static IP

with 10 comments

There are some subtle changes between Windows 7 and either Windows XP and Windows Vista. Since I use virtualization (with VMWare Fusion) extensively to test environments, I seem to go through this drill too often. By the way, I upgraded to VMWare Fusion 3 before testing the production releases of Windows 7.

The easiest Windows 7 installation uses DHCP. That’s what I did before patching the OS, installing virus protection software, and installing a few tools and program. Then, I change from a dynamic IP to static IP address and add a meaningful name to the C:\Windows\System32\Drivers\etc\hosts file. Here are the steps to set a static IP address on Windows 7:

  1. Assuming that you’re in the Category view, you should navigate to the Control Panel, choose Network and Internet, and then click Network and Sharing Center. This is the window that you should see (click image to enlarge it):

NetworkSetup1

    Click the Local Area Connection to begin configuring your static IP address.

NetworkSetup2

  1. From the Local Area Connection Status window, click the Details button to see your existing connection details (most likely DHCP). If you’re running this in VMWare Fusion, the 172.16.153.129 is the first IP address allocated. You should note the default gateway and DNS server IP address, which should always be 172.16.153.2. Click the Close button when you’ve made note of those IP addresses for subsequent steps.

NetworkSetup3

  1. Back at the Local Area Connection Status window, click the Properties button. It will show you the Local Area Connection Properties dialog. Click on the Internet Protocol Version 4 (TCP/IPv4) in the item box of the dialog window.

NetworkSetup4

  1. Click the Use the following IP address radio button and enter the appropriate values for your static IP address. The default gateway and DNS server are generally different but are the same when you’re using NAT addressing inside VMWare.

NetworkSetup5

You should be completed now. If you test the connection, Windows 7 raises and error but everything works after you reboot the operating system.

Written by maclochlainn

November 26th, 2009 at 9:34 pm

10 Responses to 'Windows 7 Static IP'

Subscribe to comments with RSS or TrackBack to 'Windows 7 Static IP'.

  1. Will those steps be the same if I’m using a wireless connection?

    anonymous

    4 Dec 09 at 9:49 pm

  2. Generally, wireless IP addresses are allotted as DHCP addresses, but you’ll need to determine the range of wireless IP addresses that are available as static IP address, then you’ll need to define the use in the DNS server.

    maclochlainn

    4 Dec 09 at 10:20 pm

  3. Hi,

    I am troubleshooting with the connection using static IP address. I found on your last picture, that there are the Valid Static IPs only to 127??? Is that right?
    Because my internet provider gave me the IP ended by 228. Is there a problem or you can think of something else? Note: I don’t have problem to connect with my Win2000 and Linux-Ubuntu. Also the adapter is working, at work I am using Dynamic IP and there is everything fine…thanks a lot.

    Roman

    8 Dec 09 at 12:43 pm

  4. It’s hard to figure out what you need from what you’ve written. Can you do the following and post the results as a followup comment?

    1. Change the network settings back to DHCP.
    2. Reboot the server.
    3. When the server is back online, open a command shell (Run cmd.exe).
    4. Run this command, and put the results in a comment:

    C:\> IPCONFIG /ALL

    This is the part of the output that would help me identify what you may require in your settings:

    Windows IP Configuration
     
       Host Name . . . . . . . . . . . . : WIN-BIX95J1IL3W
       Primary Dns Suffix  . . . . . . . :
       Node Type . . . . . . . . . . . . : Hybrid
       IP Routing Enabled. . . . . . . . : No
       WINS Proxy Enabled. . . . . . . . : No
       DNS Suffix Search List. . . . . . : localdomain
     
    Ethernet adapter Local Area Connection:
     
       Connection-specific DNS Suffix  . : localdomain
       Description . . . . . . . . . . . : Intel(R) PRO/1000 MT Network Connection
       Physical Address. . . . . . . . . : 00-0C-29-59-59-E2
       DHCP Enabled. . . . . . . . . . . : Yes
       Autoconfiguration Enabled . . . . : Yes
       Link-local IPv6 Address . . . . . : fe80::e95e:2afc:3a3c:6a68%10(Preferred)
       IPv4 Address. . . . . . . . . . . : 192.168.251.131(Preferred)
       Subnet Mask . . . . . . . . . . . : 255.255.255.0
       Lease Obtained. . . . . . . . . . : Tuesday, December 08, 2009 6:07:06 PM
       Lease Expires . . . . . . . . . . : Tuesday, December 08, 2009 6:37:08 PM
       Default Gateway . . . . . . . . . : 192.168.251.2
       DHCP Server . . . . . . . . . . . : 192.168.251.254
       DNS Servers . . . . . . . . . . . : 192.168.251.2
       Primary WINS Server . . . . . . . : 192.168.251.2
       NetBIOS over Tcpip. . . . . . . . : Enabled

    This uses 192.* because it’s single NAT’d, and the VMWare Fusion default. As a note, the posting refers to a range in the 172.* range because that’s how VMWare Fusion maps IP addresses in a double NAT’d situation. Double NAT assignments like this occur in VMWare Fusion most frequently when the host’s IP address (Mac OS X) is in the 192.* subnet.

    - The range for static IP addresses is: 172.16.153.3 to 172.16.153.127
    - The range for dynamic IP addresses is: 172.16.153.128 to 172.16.153.255

    An alternate subnet configuration for a single NAT for most ISP DHCPconfigurations would have the following ranges with a 192.* subnet.

    - The range for static IP addresses is: 192.168.0.3 to 192.168.0.127
    - The range for dynamic IP addresses is: 192.168.0.128 to 192.168.0.255

    Look forward to hearing from you.

    maclochlainn

    8 Dec 09 at 7:22 pm

  5. The properties of the IPv4 is disabled in my windows !

    how can i enable it ??

    dmha

    27 Jan 10 at 2:45 pm

  6. If you navigate to the Control Panel, Network and Internet, and Network Connections, you should see a Local Area Connection icon. Click on that icon, it launches the Local Area Connection Status dialog. Click the Details … button and you’ll get the Network Connection Details dialog. In this dialog, you should see that you have either a IPv4 Default Gateway or IPv6 Default Gateway. If you have an IPv4 IP address, you should have properties for it. My guess is that you’re using an IPv6 gateway, which means you should set the properties for the IPv6. The interesting thing is that even if you’re not using the other protocol, the Properties dialog shouldn’t be disabled. Are you the Administrator account on the machine or a delegated user?

    maclochlainn

    28 Jan 10 at 12:33 am

  7. I have three hard-wired computers connected to a Westell 327W and it reports two of them properly, but it thinks that the third has a static IP address. IPCONFIG/ALL (for each machine) that DHCP is enabled and they all use the same DNS and DCHP server.

    What is wrong?

    Thanks.

    Pete

    14 Mar 10 at 6:38 pm

  8. Have you checked the hdcpd.conf file on your router? You can check this post for how to add a static IP address configuration in a VMWare Fusion hdcpd.conf file. It’s very similar. If you find one of the machines defined with a static port in that configuration file, you can remove the lines and restart the router to see if a new dynamic port is assigned.

    Alternatively, you could have a long license setting. That would make it appears it’s static when it’s cycle time is always less than the allocated DCHP license.

    maclochlainn

    14 Mar 10 at 7:07 pm

  9. Thank you excellent! It worked!

    Doina

    6 Jul 10 at 1:41 pm

  10. Somebody asked for the command-line syntax. You can check your existing interfaces by using this command:

    netsh interface ipv4 show interfaces

    It should return something like this:

    Idx     Met         MTU          State                Name
    ---  ----------  ----------  ------------  ---------------------------
      1          50  4294967295  connected     Loopback Pseudo-Interface 1
     11          10        1500  connected     Local Area Connection

    You can reset a static IP address with two commands if you want to also reset the DNS server. You only need the first command if you’re resetting only the IP address and leaving the DNS server value unchanged. I used the same IP values as the GUI examples in the original post.

    netsh interface ipv4 set address "Local Area Connection" static 176.16.153.87 255.255.255.0 gateway 176.16.153.2
     
    netsh interface ipv4 add dnsserver="Local Area Connection" address=176.16.153.2 index=1

    maclochlainn

    22 Aug 10 at 5:36 pm

Leave a Reply