Repair and Reset TCP/IP Winsock Catalog Corruption in Windows Vista or Windows 7

Winsock 2 accommodates layered protocols. A layered protocol is one that implements only higher level communications functions, while relying on an underlying transport stack for the actual exchange of data with a remote endpoint. LSP  aka Layered Service Provider can be a security layer that adds protocol to the connection establishment process. An example of an LSP is the Microsoft Firewall Client Service Provider installed as part of the Internet Secutity and Authentication Server (ISA) on clients. The Microsoft Firewall Client Service Provider installs over the Winsock base providers for TCP and UDP.

To check which LSPs installed on your Windows Vista or Windows 7, use netsh winsock show catalog command.

Sometimes the winsock settings in Windows may get corrupted, causing errors and problems with Internet connectivity. When Winsock corrupts, the networking errors that you may face include unable to access network services, web pages, Windows update services or other odd network behaviors.

Now to reset Winsock we can use a similar cmd “netsh winsock reset”. 
What netsh winsock reset command does is it resets Winsock Catalog to a clean state or default configuration. It will remove anyWinsock LSP (Layered Service Providers) previously installed, including any potentially malfunctioning LSP that may cause the loss of network packets or transmission failures. So any previously installed LSPmust be reinstalled. This command does not affect Winsock Name Space Providers.

To repair and reset the Windows Vista or Windows 7

  1. Click on Start button.
  2. Type Cmd in the Start Search text box.
  3. Press Ctrl-Shift-Enter keyboard shortcut to run Command Prompt as Administrator. Allow elevation request.
  4. Type netsh winsock reset in the Command Prompt shell, and then press the Enter key.
  5. Restart the computer.

Good luck,

Cubert

Weird Network Issues, Can’t surf the web or web applications are failing but ping and DNS works?

There are many symptoms that may arise when you are installing a new firewall on a network that is using a DSL circuit and the MTU is not set correctly. That’s right the MTU, Max transmission Unit as it is know is a happy 1500 bytes on any Ethernet,  that medium makes up most endpoint networks on the Internet. Most admins never think about what the MTU is set at the gateway device, when they forget to realize that the circuit to the Internet is a DSL circuit they may see things on the network that can’t seem to explain.

MTU is the maximum packet size (in bytes) that can be transported reliably across any particular network; IP Ethernet in this case. The maximum size of an IP Ethernet packet is 1500, but overhead like IP, TCP, and PPPoE must also be taken into account. The wrong MTU will actually prevent you from accessing some web sites or FTP sites. It may even cause you to not authenticate properly on mail servers or secure web sites. There are too many variables to be able to estimate what your optimum MTU should be but my rule of thumb is -32bytes which makes the MTU 1468.

If your running a VPN to a remote domain and you are having domain failures that don’t seem to make since? Some people have no issues and others fail with different errors when the should work?

Only some websites working correctly?

DNS and ping work but other services  may fail like mail or ftp?

What maybe taking place is a conflict in the MTU available on a DSL circuit. The Ethernet is placing packets on the wire at up to 1500 bytes each but the DSL has only 14XX bytes available to it so a fragment has to take place that ends up breaking the request being made.

It is simple to overcome such a issue by setting the MTU of your firewalls DSL facing Ethernet device. This will then cause the firewall to regulate the MTU and control the MTU going out to the DSL circuit.

You can also change the MTU in a Windows workstation so it will not send out a packet bigger than what the DSL circuit can handle.

To do this edit the registry with REGEDIT and change the following key.

[HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters\
Interfaces\[Adapter ID]]

Value Name: MTU
Data Type: REG_DWORD (DWORD Value)
Value Data: Default = 0xffffffff (1500)

This will fix the Windows system but I prefer to do it at the firewall so one edit changes all systems. Do what you need to do.

Hope this helps someone out there

 

Cubert

How to configure Windows TCP/IP settings from the Command Prompt (CLI)

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure

Window’s Netsh.exe command-line scripting utility  allows you to display or modify the network configurations of any computer that is currently running a resent flavor of Windows. Netsh.exe also provides a scripting feature that allows you to run a group of commands in batch mode against a computer both locally and remotely.  You can also use Netsh.exe to save a configuration script in a text file for archival purposes or to help you configure network information when changing networks.

Here are your commands and what they can do.

View your TCP/IP settings.

netsh interface ip show config

 

Configure your computer’s IP address and other TCP/IP related settings.

This command configures the interface named Local Area Connection with the static IP address 192.168.0.101, the subnet mask of 255.255.255.0, and a default gateway of 192.168.0.1:

netsh interface ip set address name="Local Area Connection" static 192.168.0.101 255.255.255.0 192.168.0.1 1

Configure your NIC to automatically obtain an IP address from a DHCP server

netsh interface ip set address "Local Area Connection" dhcp

To configure DNS and WINS addresses from the Command Prompt

netsh interface ip set dns "Local Area Connection" static 192.168.0.101
netsh interface ip set wins "Local Area Connection" static 192.168.0.101

To configure your NIC to dynamically obtain it’s DNS settings

netsh interface ip set dns "Local Area Connection" dhcp

Now let’s say you have a laptop and it travels between 2 separate networks and you need to maintain separate static configurations for each network. There is a simple way to flip back and forth between networks by creating a simple batch file. Here is how it’s done.

First we export your current IP settings to a text file:

netsh -c interface dump > c:\network1.txt

Next we change the settings manually on the interface to the second network and then export it as well:

netsh -c interface dump > c:\network2.txt

Now we have 2 text files, each file represents a network location. Whenever you need to quickly change your IP settings to switch between networks you can run the following commands

netsh -f c:\network1.txt
or
netsh -f c:\network2.txt

Now to make a batch file to execute the command just create a file called network1.bat and network2.bat and add the perspective line to that file. You can also use the global EXEC switch instead of  “-f ”  switch in the batch file with the same results.

Here are all the options available to netsh.exe

Usage: netsh [-a AliasFile] [-c Context] [-r RemoteMachine] [-u [DomainName\]UserName] [-p Password| *]
    

Commands available:

?              – Displays a list of commands.
add            – Adds a configuration entry to a list of entries.
advfirewall    – Changes to the `netsh advfirewall’ context.
branchcache    – Changes to the `netsh branchcache’ context.
bridge         – Changes to the `netsh bridge’ context.
delete         – Deletes a configuration entry from a list of entries.
dhcp           – Changes to the `netsh dhcp’ context.
dhcpclient     – Changes to the `netsh dhcpclient’ context.
dnsclient      – Changes to the `netsh dnsclient’ context.
dump           – Displays a configuration script.
exec           – Runs a script file.
firewall       – Changes to the `netsh firewall’ context.
help           – Displays a list of commands.
http           – Changes to the `netsh http’ context.
interface      – Changes to the `netsh interface’ context.
ipsec          – Changes to the `netsh ipsec’ context.
lan            – Changes to the `netsh lan’ context.
mbn            – Changes to the `netsh mbn’ context.
namespace      – Changes to the `netsh namespace’ context.
nap            – Changes to the `netsh nap’ context.
netio          – Changes to the `netsh netio’ context.
p2p            – Changes to the `netsh p2p’ context.
ras            – Changes to the `netsh ras’ context.
rpc            – Changes to the `netsh rpc’ context.
set            – Updates configuration settings.
show           – Displays information.
trace          – Changes to the `netsh trace’ context.
wcn            – Changes to the `netsh wcn’ context.
wfp            – Changes to the `netsh wfp’ context.
winhttp        – Changes to the `netsh winhttp’ context.
winsock        – Changes to the `netsh winsock’ context.
wlan           – Changes to the `netsh wlan’ context.

 

Enjoy

Cubert