DESKTOP

Windows 7 : Understanding TCP/IP (part 2)

7/14/2011 4:07:33 PM

4. Configuring TCP/IP on Windows 7

Windows 7 can use either IPv4 or IPv6 to communicate with other machines on a network, but the Windows 7 machine must receive the TCP/IP address. There are two ways that a Windows 7 machine can get a TCP/IP address: statically or dynamically.

4.1. Assigning Static TCP/IP Numbers

As an administrator, it may be necessary to configure a Windows 7 machine manually (static configuration). To configure a Windows 7 machine manually, you must know the following:

  • Which TCP/IP address the machine will receive

  • What the subnet mask is

  • What the default gateway (router's TCP/IP address) is

  • What the DNS TCP/IP addresses are

Complete Exercise 1 to configure a Windows 7 machine to use a static TCP/IP address. This example uses TCP/IP addresses for a local network, but you can use your own TCP/IP addresses if you know what they should be.

Exercise 1: Configuring a Static TCP/IP Address

  1. Click Start and type Network and Sharing Center in the Windows 7 integrated search box.

  2. In the Network and Sharing Center window, click the Local Area Connection item in the View Your Active Networks section.

  3. Click the Properties button from the Activity section of the Local Area Connection Status box.

  4. In the Local Area Connection Properties dialog box, click to select (do not deselect the check box) Internet Protocol Version 4 (TCP/IPv4) and click the Properties button, Manual configuration will work with both IPv4 and IPv6.

  5. Under the General tab, click the Use The Following IP Address radio button. Type in the following (unless you want to use your own settings):

  6. IP Address: 192.168.1.50

  7. Subnet Mask: 255.255.255.0

  8. Default Gateway: 192.168.1.1

  9. Click the Use The Following DNS Server Addresses radio button and type in 4.2.2.2 (unless you want to use your own settings) in the TCP/IP Address field.

  10. Click OK.


Now let's take a look at how to configure a Windows 7 machine to use DHCP.

5. Configuring a Windows 7 Machine to use DHCP

Dynamic IP configuration assumes that you have a DHCP server on your network that is reachable by the DHCP clients. DHCP servers are configured to automatically provide DHCP clients with all their IP configuration information, including IP address, subnet mask, and DNS server.

For large networks, DHCP is the easiest and most reliable way of managing IP configurations. By default, a Windows 7 machine is configured as a DHCP client for dynamic IP configuration.

Complete Exercise 2 to configure a Windows 7 machine to use dynamic IP configuration.

Exercise 2: Using DHCP

  1. Click Start and type Network and Sharing Center in the Windows 7 integrated search box.

  2. In the Network and Sharing Center window, click the Local Area Connection item in the View Your Active Networks section.

  3. Click the Properties button from the Activity section of the Local Area Connection Status box.

  4. In the Local Area Connection Properties dialog box, click to select (do not deselect the check box) Internet Protocol Version 4 |TCP/IPv4) and click the Properties button. DHCP will work with both IPv4 and IPv6.

  5. Choose the Obtain An IP Address Automatically radio button from the General tab of the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box.

  6. Choose the Obtain DNS Server Address Automatically radio button from the General tab of the Internet Protocol Version 4 (TCP/IPv4) Properties dialog box.

  7. To use this configuration, click OK to accept the selection and close the dialog box. To exit without saving (if you had a valid static configuration), choose Cancel.


If you are using DHCP and you are not connecting to other machines properly, you can do an i pconf i g /al 1 to see what your TCP/IP address is. If your TCP/IP address starts with 169.254.x.x, you are not connecting to the DHCP server and your Windows 7 machine is using APIPA.

5.1. Understanding APIPA

Automatic Private IP Addressing (APIPA) is used to automatically assign private IP addresses for home or small business networks that contain a single subnet, have no DHCP server, and are not using static IP addressing. If APIPA is being used, clients will be able to communicate only with other clients on the same subnet that are also using APIPA. The benefit of using APIPA in small networks is that it is less tedious and has less chance of configuration errors than statically assigning IP addresses and configuration. APIPA is used with Windows 7 under the following conditions:

  • When the client is configured as a DHCP client, but no DHCP server is available to service the DHCP request.

  • When the client originally obtained a DHCP lease from a DHCP server, but when the client tried to renew the DHCP lease, the DHCP server was unavailable and the lease period expired.

APIPA uses a Class B network address space that has been reserved for its use. The address space is the 169.254.0.0 network, where the range of 169.254.0,1-169.254,255,254 is available for the host to assign to themselves. The steps that APIPA uses are as follows:

  1. The Windows 7 client attempts to use a DHCP server for its configuration, but no DHCP servers respond.

  2. The Windows 7 client selects a random address from the 169.254.0.1-169.254.255.254 range of addresses and will use a subnet mask of 255.255.0.0.

  3. The client uses a duplicate-address detection method to verify that the address it selected is not already in use on the network.

  4. If the address is already in use, the client repeats steps 1 and 2. If the address is not already in use, the client configures its network interface with the address it randomly selected, if you note the number of the address the APIPA client can select from (65536 addresses), the odds of selecting a duplicate is very slim.

  5. The Windows 7 network client continues to search for a DHCP server every five minutes. If a DHCP server replies to the request, the APIPA configuration is dropped and the client receives new IP configuration settings from the DHCP server.

You can determine whether your network interface has been configured using APIPA by looking at your IP address. You can do this easily from the command interpreter by using the ipconfig /al 1 command. Let's take a look at how to test your TCP/IP configuration.

6. Testing IP Configuration

After you have installed and configured the TCP/IP settings, you can test the IP configuration by using the ipconfig, ping, and nbtstat commands. These commands are also useful in troubleshooting IP configuration errors. You can also graphically view connection details through the Local Area Connection Status of the Network and Sharing Center.

6.1. Using the ipconfig command

The ipconfig command displays your IP configuration. Table 8 lists the command switches that you can use with the ipconfig command.

Table 8. Ipconfig Switches
SwitchDescription
/7Shows all of the help options for i pconfi 9
/ a11Shows verbose information about your IP configuration, including your computer's physical address, the DNS server you are using, and whether you are using DHCP"
/allcompartmentsShows IP information for all compartments"
/releaseReleases an IPv4 address that has been assigned through DHCP
/release6Releases an IPv6 address that has been assigned through DHCP
/renewRenews an IPv4 address through DHCP
/renew6Renews an IPv6 address through DHCP
/flushdnsPurges the DNS Resolver cache
/registerdnsRefreshes DHCP leases and re-registers DNS names
/displaydnsDisplays the contents of the DNS Resolver Cache
/showclassidLists the DHCP class IDs allowed by the computer
/setclassIDAllows you to modify the DHCP class ID

If TCP/IP is still not working properly on the Windows 7 machine, you may need to do some troubleshooting.

7. TCP/IP Troubleshooting

If you are having trouble connecting to network resources, you might want to check the following:

  • If you can access resources on your local subnet but not on a remote subnet, you should check the default gateway settings on your computer. Pinging a remote host and receiving a Destination Unreachable message is also related to default gateway miscon figuration.

  • If you can access some but not all resources on your local subnet or remote subnet, you should check your subnet mask settings, the wiring to those resources, or the devices between your computer and those resources.

  • Use the ipconfig utility to ensure that you are not configured with an APIPA address. If so, determine why you are not receiving IP settings from your DHCP server.

  • If you can access a resource (for example, by pinging a computer) by IP address, but not by name, you should check the DNS settings on your computer.

After we have TCP/IP set up on our Windows 7 machine, we can then connect the Windows 7 machine to the network. In the next section, you will look at how to connect Windows 7 to a network.

Other  
  •  Windows Server 2008 : Planning Operating System Virtualization (part 2) - Planning for Server Consolidation
  •  Windows Server 2008 : Planning Operating System Virtualization (part 1)
  •  Windows Server 2003 : Troubleshooting Group Policy
  •  Windows Server 2003 : Working with Resultant Set of Policy (part 2)
  •  Windows Server 2003 : Working with Resultant Set of Policy (part 1) - Generating RSoP Queries with the Resultant Set Of Policy Wizard
  •  Configuring Windows 7 NIC Devices (part 2) - Configuring Wireless NIC Devices
  •  Configuring Windows 7 NIC Devices (part 1) - Configuring a Network Adapter & Troubleshooting a Network Adapter
  •  Windows 7 : Configuring Network Connectivity - Understanding Networking
  •  Preparing to Install Windows 7 (part 2) - New Install or Upgrade
  •  Preparing to Install Windows 7 (part 1) - Different Versions of Windows 7 & Hardware Requirements
  •  Maintaining Windows 7 with Backup and Restore (part 2) - Using Advanced Backup Options & Using System Protection
  •  Maintaining Windows 7 with Backup and Restore (part 1) - Creating a Backup & Restoring Files from a Backup
  •  Windows 7 : Configuring Backups and Recovery - Using Advanced Boot Options
  •  Windows Server 2003 : Implementing a GPO (part 2) - Modifying a GPO
  •  Windows Server 2003 : Implementing a GPO (part 1)
  •  Windows 7 : Using Windows Live Calendar (part 3) - Scheduling Appointments and Meetings & Viewing Agendas and Creating To-Do Lists
  •  Windows 7 : Using Windows Live Calendar (part 2) - Sharing Your Calendars with Others & Synchronizing Google Calendar with Windows Live Calendar
  •  Windows 7 : Using Windows Live Calendar (part 1)
  •  Windows 7 : Using Windows Live Contacts
  •  Windows 7: Using Windows Live Mail (part 3)
  •  
    Top 10
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 6)
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 5)
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 4)
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 3)
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 2)
    Group Test: AMD FX-8350, FX-8320, FX-6300 And FX-4300 - All Vishera Processors (Part 1)
    Excellent Features From NFC Technology
    Outstanding Mobile Apps – April 2013 (Part 2)
    Outstanding Mobile Apps – April 2013 (Part 1)
    9 Free Video Editing Tools
    Most View
    Extending Safari Easily
    Programming the iPhone : Tables and Embedded Controls
    Programming .NET Framework 3.5 : Placing Text
    The Hacked Man (Part 2) - Digital gold: passwords and mail addresses
    Blackberry 10 - Aiming For A Perfect 10
    IFA 2012 Already Overbooked! (Part 1)
    Managing Cached Content
    Online Radio Tuner
    Microsoft Dynamic CRM 2011 : Working with Contracts and Queues - Working with Service Queues
    SharePoint 2010 : Understanding Windows PowerShell Concepts (part 2)
    ASP.NET 4 in VB 2010 : XML Validation (part 1) - XML Namespaces, XML Schema Definition
    Mobile Viruses the risk keeps growing (Part 1)
    Gamepad - How It Works (Part 1) - Arcade fever
    Canon LV-7290 : Affordable Yet Amazing
    Corel Painter X : The Great Outdoors - Landscape
    2012 Make It Worth ( Part 2)
    IIS 7.0 : Securing Configuration - Restricting Access to Configuration
    Programming Microsoft SQL Server 2005: Using the Data Mining Wizard and Data Mining Designer (part 1) - Creating a Mining Structure
    The Mayans Were Wrong (Part 2)
    Windows Server 2008 : DHCP/WINS/Domain Controllers - Exploring the Dynamic Host Configuration Protocol (DHCP)