Network troubleshooting with Netsh

Every have that laptop or netbook that connects to your computer but won’t go online at another location? You can quickly rebuild the IP stack and force the computer to get online at another location by typing the following command:

netsh int ip reset C:iplog.txt

Of course if you have a computer that won’t get online even if it has an ip address, do several things –

  • Click Start Menu, type cmd in the search box or run box ( Hold down Ctrl + Shift and hit Enter)Type the following commands, each followed by pressing enter.
  • ipconfig /flushdns
  • nbtstat -R
  • nbtstat -RR
  • netsh int reset all
  • netsh int ipv4 reset
  • netsh winsock reset catalog
This will rebuild the tcp/ip protocol stack (fully)

After rebooting, run a command prompt as an administrator and type:

  • netsh interface tcp set global autotuninglevel=disabled

Reboot


How about tweaking your network for a little more speed?

Here’s a set of quick tweaks to adjust Windows 7 networking.  Always backup your computer before performing any tweak.

Open a command prompt as an administrator and type the following –

netsh int tcp set global congestionprovider=ctcp
netsh int tcp set global ecncapability=default
netsh int tcp set global chimney=enabled
netsh int tcp set global dca=enabled
netsh int tcp set global netdma=enabled
netsh int tcp set global autotuninglevel=disabled
netsh int tcp set heuristics disabled

CTCP or Compound TCP – Improves throughput
ECN-provides routers with an alternate method of communicating network congestion
TCP Chimney Offload – Offloads all TCP processing for a connection to your network adapter
Direct Cache Access (DCA) – or direct cache access allows a network controller to deliever data directly to your cpu cache
NetDMA – enables support for advanced direct memory access.
TCP Autotuning – RWIN auto tuning behavior
Heuristics – Windows 7 has the ability to automatically change its own TCP Window auto-tuning behavior

To return to your default settings, go to a command prompt as an administrator and type –

netsh int tcp set heuristics default
netsh int tcp set global chimney=default
netsh int tcp set global autotuninglevel=normal
netsh int tcp set global congestionprovider=default
netsh int tcp set global ecncapability=default
netsh int tcp set global netdma=disable
netsh int tcp set global dca=auto

If you have trouble navigating to sites and time out to Facebook or Microsoft for example, or you want to improve your download speeds -you may need to set your MTU settings –

So what do you set your MTU to?  Normally your MTU is set to 1500.   Every connection is different.  First log into your router if you have one and set it to 1492.  Retry the sites that are timing out.  If this did not work, you may need to set the MTU on your network card.

Use TCPOptimizer for Windows XP, Vista or Windows 7 (easy) –

or you can go to a command prompt (as an administrator with elevated privileges) and type –

netsh interface ipv4 show subinterface

(to see the name of your network Interface – it is important to write down the MTU settings and network interface name at this time)

To set the MTU value to 1472 (you can also try 1492, type the following command at a a command prompt (Note: You MUST substitute the name of your network connection  –

netsh interface ipv4 set subinterface “The Name of Your Connection” mtu=1472 store=persistent

Many users have reported an increase in download and internet speeds after adjusting their MTU to 1472.  This setting may not be the optimal setting everyone.

Modify LLMNR by doing the following:

Modify Group Policy – Go to Search – Type GPEdit.msc – Enter – Navigate to the following and make sure Enabled is checked – Computer Configuration\Administrative Templates\Network\DNS Client
\Turn off Multicast Name Resolution = Enabled


How is your network card and computer routing?

Use the following command to see the routing table – from the command prompt type –

netsh interface  ipv4 show route

Publish  Type      Met  Prefix                    Idx  Gateway/Interface Name
-------  --------  ---  ------------------------  ---  ------------------------
No       Manual    0    0.0.0.0/0                  11  192.168.2.1
No       Manual    256  127.0.0.0/8                 1  Loopback Pseudo-Interface 1
No       Manual    256  127.0.0.1/32                1  Loopback Pseudo-Interface 1
No       Manual    256  127.255.255.255/32          1  Loopback Pseudo-Interface 1
No       Manual    256  192.168.2.0/24             11  Wireless Network Connection
No       Manual    256  192.168.2.77/32            11  Wireless Network Connection
No       Manual    256  192.168.2.255/32           11  Wireless Network Connection
No       Manual    256  224.0.0.0/4                 1  Loopback Pseudo-Interface 1
No       Manual    256  224.0.0.0/4                11  Wireless Network Connection
No       Manual    256  255.255.255.255/32          1  Loopback Pseudo-Interface 1
No       Manual    256  255.255.255.255/32         11  Wireless Network Connection
 
If you want to see your specific routes per interface you can do that using type the following 
at a command prompt=

netsh interface ipv4 show route verbose

Destination Prefix:     0.0.0.0/0
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: 192.168.2.1
Publish:                No
Type:                   Manual
Metric:                 0
SitePrefixLength        0
ValidLifeTime           584415
PreferredLifeTime       584415

Destination Prefix:     127.0.0.0/8
Source Prefix:          0.0.0.0/0
Interface Index:        1
Gateway/Interface Name: Loopback Pseudo-Interface 1
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     127.0.0.1/32
Source Prefix:          0.0.0.0/0
Interface Index:        1
Gateway/Interface Name: Loopback Pseudo-Interface 1
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     127.255.255.255/32
Source Prefix:          0.0.0.0/0
Interface Index:        1
Gateway/Interface Name: Loopback Pseudo-Interface 1
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     192.168.2.0/24
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: Wireless Network Connection
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     192.168.2.77/32
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: Wireless Network Connection
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     192.168.2.255/32
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: Wireless Network Connection
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     224.0.0.0/4
Source Prefix:          0.0.0.0/0
Interface Index:        1
Gateway/Interface Name: Loopback Pseudo-Interface 1
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     224.0.0.0/4
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: Wireless Network Connection
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     255.255.255.255/32
Source Prefix:          0.0.0.0/0
Interface Index:        1
Gateway/Interface Name: Loopback Pseudo-Interface 1
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

Destination Prefix:     255.255.255.255/32
Source Prefix:          0.0.0.0/0
Interface Index:        11
Gateway/Interface Name: Wireless Network Connection
Publish:                No
Type:                   Manual
Metric:                 256
SitePrefixLength        0
ValidLifeTime           Infinite
PreferredLifeTime       Infinite

What type of network card do you have and does the driver support what you are connecting to?

Open a command prompt as an administrator and type –

netsh wlan show drivers


Is your firewall grayed out? Can’t enable it?

Do you need to reset your Windows 7 Firewall?

1. Open a command prompt window as an administrator (hold Crl-Shift then hit enter).

2. On the command prompt type netsh advfirewall reset .

C:\>netsh advfirewall reset Press Enter


Want to see the IP packet information for your network card?

Open a Command Prompt as an Administrator

Type netsh interface ip show ipstats

The same command can be used for TCP and UDP stats

There is a ton of other netsh commands that control your network cards and how they operate.  You can get a quick list by going to the command prompt and typing netsh /?

Advertisements

About TCAT Shelbyville IT Department

The Tennessee College of Applied Technology - is one of 46 institutions in the Tennessee Board of Regents System, the seventh largest system of higher education in the nation. This system comprises six universities, fourteen community colleges, and twenty-six Applied Technology Colleges.
This entry was posted in Computers and tagged , , , , , , , , . Bookmark the permalink.

One Response to Network troubleshooting with Netsh

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s