Thursday, 29 March 2007

TroubleShooting: How to reset Internet Protocol (TCP/IP) in Windows XP & Vista

Occasionally there are seemingly unexplained reasons for no network communication on a system.

Sometimes the removal of a software firewall or some sort of OS update can be seen as responsible.

Either way, we may need to reset the TCP stack. XP follows, Vista is further below.

The following Microsoft KB 299357: How to reset Internet Protocol (TCP/IP) in Windows XP explains the ins and outs of the methodology.

Simply:

netsh int ip reset c:\resetlog.txt

The resetlog.txt will be made in the root of the drive where it can be scanned for any errors.

Generally, you are back in business!

Okay, in the case of the system I am working on now ... NOT. :D

Next step:

In the CMD window where I release the IP and try and renew it I am getting the following error: You receive an "An operation was attempted on something that is not a socket".

The following Microsoft KB 817517: You receive an "An operation was attempted on something that is not a socket" error message when you try to connect to a network contains further steps to take on, in this case, Windows XP:

Export and delete the corrupted registry subkeys

  1. Insert a floppy disk in the floppy disk drive of the computer whose registry entries you are exporting.
  2. Click Start, click Run, type regedit, and then click OK.
  3. Locate and then click the following registry subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock
  4. Do one of the following steps, depending on the operating system:
    • For Windows XP, on the File menu, click Export.
    • For Windows 2000, on the Registry menu, click Export.
  5. In the Save in box, click 3½ Floppy (A:), type a name for the file in the File name box, and then click Save.
  6. Right-click Winsock, and then click Delete. When you are prompted to confirm the deletion, click Yes.
  7. Repeat steps 3 through 6 for the following subkey:
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Winsock2
    Note Each .reg file that you save must have a different name.
  8. Right-click Winsock2, click Delete, and then click Yes.
  9. Quit Registry Editor.
Then on to the following for an XP based system:

Reinstall TCP/IP on a Windows XP-based computer

In Windows XP, the TCP/IP stack is a core component of the operating system. Therefore, you cannot remove TCP/IP in Windows XP.

  1. Install TCP/IP on top of itself. To do this, follow these steps:
    1. a. In Control Panel, double-click Network Connections, right-click Local Area Connection, and then click Properties.
    2. Click Install.
    3. Click Protocol, and then click Add.
    4. Click Have Disk.
    5. In the Copy manufacturer's files from box, type System_Drive_Letter:\windows\inf, and then click OK.
    6. In the list of available protocols, click Internet Protocol (TCP/IP), and then click OK.
  2. Restart your computer.

After the reboot, the system should come up and have network connectivity.

In our case, the problem has turned out to be the Panda Platinum Internet Security 2006.

As soon as I uninstalled the product, the system had network connectivity. Going to try and reinstall it to see if it breaks things again.

UPDATE 07-05-07: For Windows Vista: A lot of searches are ending up here looking for the ability to reset the TCP stack in Windows Vista.

The first place to start is to run the native Vista repair feature:

  1. Click Start
  2. Type "Network" in Start Search
  3. Click on Network and Sharing Center in the results
  4. Click on Diagnose and repair (bottom of left list)

  5. Run through the prompts to repair the connection.
If that doesn't fix the situation, then a manual reset of both Winsock and the TCP/IP stack would be in order.

  1. Winsock
    1. Click on Start
    2. Type CMD in Start Search
    3. Right click on the result and run as Administrator
    4. netsh winsock reset [Enter]
    5. exit [Enter]
    6. Restart the system

  2. TCP/IP protocol
    1. Bring up the command prompt authenticated as Administrator (steps 1-3 just above)
    2. netsh int ip reset [Enter]
    3. exit [Enter]
    4. Restart the system
On SBS Premium based networks, make sure that the proxy settings are correct in the browser and that IE is seen hitting ISA via the ISA live logging feature.

Make sure that the correct drivers are installed on the system, that the connectivity lights on the NIC and at the switch are lit and active.

Check your patch cables, especially for laptops.

If you need further Vista related troubleshooting tips: Gateway Support: Windows Vista - Troubleshooting Network Connections.

Philip Elder
MPECS Inc.
Microsoft Small Business Specialists

2 comments:

Anonymous said...

I test it. It works

Philip Elder Cluster MVP said...

A,

Thanks for that!

Philip