Microsoft KB Archive/875357

= Troubleshooting Windows Firewall settings in Windows XP Service Pack 2 for advanced users =

Article ID: 875357

Article Last Modified on 11/29/2007

-

APPLIES TO


 * Microsoft Windows XP Professional
 * Microsoft Windows XP Home Edition

-



Notice
This article is intended for advanced computer users. If you are not comfortable with advanced troubleshooting, you might want to ask someone for help or contact support. For information about how to do this, visit the following Microsoft Web site:

http://support.microsoft.com/contactus/



SUMMARY
''Windows XP Service Pack 2 (SP2) includes Microsoft Windows Firewall, the updated firewall software that replaces Internet Connection Firewall (ICF). If Microsoft Windows Firewall is blocking a port that is used by a service or by a program, you can configure the Windows Firewall to create an exception. Windows Firewall may be blocking a program or a service if the following conditions are true:''
 * Programs do not respond to a client's request.
 * Client programs do not receive data from the server.

''A Windows Firewall Security Alert may notify you that Windows Firewall is blocking a particular program. When this scenario occurs, you may unblock the program by selecting Unblock this program in the Security Alert dialog box. To help determine which programs and ports are being blocked, you can configure Windows Firewall to log dropped packets. With Windows Firewall Netsh Helper, you can configure Windows Firewall and Windows Firewall logging at the command prompt. Program compatibility may not always be the issue. Group Policy settings can also prevent programs from running. Windows XP Service Pack 2 (SP2) includes several utilities that you can use to troubleshoot Windows Firewall issues.''



INTRODUCTION
The best way to resolve firewall blocking issues is to modify programs to work with stateful filtering firewalls. If you cannot modify a program, you can configure the Windows Firewall to add exceptions for specific ports and programs. This article discusses the failure symptoms that relate to the default configuration of the Windows XP Service Pack 2 firewall, how to configure exceptions for ports and for programs, and how to perform some troubleshoot methods for firewall settings.



MORE INFORMATION
Failures that are related to the default firewall configuration appear in two ways. Client programs may not receive data from a server. Server programs that are running on a Windows XP-based computer may not respond to client requests.

If a program is being blocked, you may receive the following Windows Firewall Security Alert:



For information about these symptoms and advanced troubleshooting steps to resolve them, see the &quot;Advanced troubleshooting&quot; section.

Configuring Windows Firewall by using the Windows Firewall Security Alert
To unblock the program, click Unblock in the Security Alert dialog box.

Adding a program exception
When you add a program to the exception list, you enable the firewall to open ranges of ports that could change every time the program is run. To add a program exception, follow these steps:  Use an administrator account to log on. Click Start, click Run, type wscui.cpl, and then click OK. In Windows Security Center, click Windows Firewall. On the Exceptions tab, click Add Program. In the list of programs, click the name of the program that you want to add, and then click OK. If the name of your program is not in the list of programs, click Browse to locate the program, and then click OK. Note If you do not know where the program is located, contact the program vendor to determine the program location.

For information about how to contact your program vendor, click the appropriate article number in the following list to view the article in the Microsoft Knowledge Base:

65416 Hardware and software vendor contact information, A-K

60781 Hardware and software vendor contact information, L-P

60782 Hardware and software vendor contact information, Q-Z

 Click OK.</li> Test the program to verify that the firewall settings are correct.</li></ol>

If you are still experiencing problems, you might want to ask someone for help or contact support. For information about how to do this, visit the following Microsoft Web site:

http://support.microsoft.com/contactus

Advanced troubleshooting
This section is intended for advanced computer users. If you are not comfortable with advanced troubleshooting, you might want to ask someone for help or contact support. For information about how to do this, visit the following Microsoft Web site:

http://support.microsoft.com/contactus

Recognizing failure symptoms
Failures that are related to the default firewall configuration appear in two ways: <ul> Client programs may not receive data from a server. For example, the following client programs may not receive data: <ul> An FTP client</li> Multimedia streaming software</li> New mail notifications in some e-mail programs</li></ul> </li> Server programs that are running on a Windows XP-based computer may not respond to client requests. For example, the following server programs may not respond: <ul> A Web server program, such as Internet Information Services (IIS)</li> Remote Desktop</li> File sharing</li></ul>

Notes <ul> Failures in network programs are not limited to firewall issues. These failures may be caused by RPC or DCOM security changes. Therefore, you have to determine whether the failure is accompanied by a Windows Firewall Security Alert that indicates that a program is being blocked.</li> Service failures are not accompanied by a Windows Firewall Security Alert because services are not typically associated with a user logon session. If the failure is service-related, configure the firewall as discussed in the &quot;Configuring Windows Firewall by using the Windows Security Center&quot; section.</li></ul> </li></ul>

Adding a port exception
If you do not resolve this issue by adding a program to the exception list, you can add ports manually. To do this, you must first identify the ports that are used by the program. A reliable way to determine port usage is to contact the program vendor. If you cannot contact a vendor, or if a port list is not available, you can use the Netstat.exe tool to identify the ports in use.

Identifying the ports

 * 1) Start the program and try to use its network features. For example, with a multimedia program, try to start an audio stream. With a Web server, try to start the service.
 * 2) Click Start, click Run, type cmd, and then click OK.
 * 3) At the command prompt, type netstat –ano > netstat.txt, and then press ENTER. This command creates the Netstat.txt file. This file lists all the listening ports.




 * 1) At the command prompt, type tasklist > tasklist.txt, and then press ENTER. If the program in question runs as a service, type tasklist /svc > tasklist.txt instead of tasklist > tasklist.txt so that the services that are loaded in each process are listed.






 * 1) Open the Tasklist.txt file, and then locate the program that you are troubleshooting. Write down the Process Identifier for the process, and then open the Netstat.txt file. Note any entries that are associated with that Process Identifier and the protocol that is used.



If the port numbers for the process are less than 1024, the port numbers will probably not change. If the numbers that are used are greater than or equal to 1024, the program may use a range of ports. Therefore, you may not be able to resolve the issue by opening individual ports.

Adding the port exception

 * 1) Click Start, click Run, type wscui.cpl, and then click OK.
 * 2) In Windows Security Center, click Windows Firewall.




 * 1) Click the Exceptions tab, and then click Add Port to display the Add a Port dialog box.




 * 1) Type a descriptive name for the port exception and the port number that your program uses, and then select either the TCP or UDP protocol.




 * 1) Click Change Scope.


 * 1) View or set the scope for the port exception, and then click OK.




 * 1) Click OK to close the Add a Port dialog box.




 * 1) To verify that the port settings are correct for your program, test the program.

Using Logging
You can enable logging to help identify the source of inbound traffic and to provide details on what traffic is being blocked. %Windir%\pfirewall.log is the default log file. To enable logging, follow these steps:
 * 1) Click Start, click Run, type firewall.cpl, and then click OK.
 * 2) Click the Advanced tab.




 * 1) In the Security Logging area, click Settings.




 * 1) Click to select the Log dropped packets check box, and then click OK.




 * 1) Click OK.



Note Outbound successes are not logged. Outbound traffic that is not blocked is not logged.

Interpreting the log file
The following log information is collected for each packet that is logged:

Note The hyphen (-) is used for fields where no information is available for an entry.

Using command-line support
Windows Firewall Netsh Helper was added to Windows XP in the Microsoft Advanced Networking Pack. This command-line helper previously applied to IPv6 Windows Firewall. With Windows XP Service Pack 2, the helper now includes support for configuring IPv4.

With Netsh Helper, you can now:
 * Configure the default state of Windows Firewall. (Options include Off, On, and On with no exceptions.)
 * Configure the ports that must be open.
 * Configure the ports to enable global access or to restrict access to the local subnet.
 * Set ports to be open on all interfaces or only on a specific interface.
 * Configure the logging options.
 * Configure the Internet Control Message Protocol (ICMP) handling options.
 * Add or remove programs from the exceptions list.

These configuration options apply to both IPv4 Windows Firewall and IPv6 Windows Firewall except where specific functionality does not exist in the Windows Firewall version.

Gathering diagnostic data
Windows Firewall configuration and status information can be retrieved at the command line by using the Netsh.exe tool. This tool adds IPv4 firewall support to the following Netsh context:

netsh firewall

To use this context, type netsh firewall at a command prompt, and then use additional Netsh commands as needed. The following commands are useful for gathering firewall status and configuration information:
 * Netsh firewall show state
 * Netsh firewall show config

Compare the output from these commands with the output from the netstat –ano command to identify the programs that may have listening ports open and that do not have corresponding exceptions in the firewall configuration. Supported data gathering and configuration commands are listed in the following tables.

Note Settings can be modified only by an administrator.

Data Gathering

Configuration

Troubleshooting the firewall
Along with program compatibility issues, the Windows Firewall may experience other problems. Follow these steps to diagnose problems: <ol> To verify that TCP/IP is functioning correctly, use the ping command to test the loopback address (127.0.0.1) and the assigned IP address.</li> Verify the configuration in the user interface to determine whether the firewall has been unintentionally set to Off or On with No Exceptions.</li> Use the netsh commands for Status and Configuration information to look for unintended settings that could be interfering with expected behavior.</li> Determine the status of the Windows Firewall/Internet Connection Sharing service by typing the following at a command prompt:

sc query sharedaccess

(The short name of this service is SharedAccess.) Troubleshoot service startup based on the Win32 exit code if this service does not start.</li> Determine the status of the Ipnat.sys firewall driver by typing the following at a command prompt:

sc query ipnat

This command also returns the Win32 exit code from the last start try. If the driver is not starting, use troubleshooting steps that would apply to any other driver.</li> <li>If the driver and service are both running, and no related errors exist in the event logs, use the Restore Defaults option on the Advanced tab of Windows Firewall properties to eliminate any potential problem configuration.</li> <li>If the issue is still not resolved, look for policy settings that might produce the unexpected behavior. To do this, type GPResult /v > gpresult.txt at the command prompt, and then examine the resulting text file for configured policies that are related to the firewall.</li></ol>

Configuring Windows Firewall Group Policy
Contact your network administrator to determine if a Group Policy setting prevents programs and scenarios from running in a corporate environment.

Windows Firewall Group Policy settings are located in the following Group Policy Object Editor snap-in paths:
 * Computer Configuration/Administrative Templates/Network/Network Connections/Windows Firewall
 * Computer Configuration/Administrative Templates/Network/Network Connections/Windows Firewall/ Domain Profile
 * Computer Configuration/Administrative Templates/Network/Network Connections/Windows Firewall/ Standard Profile

From these locations, you can configure the following Group Policy settings:
 * Windows Firewall: Allow authenticated Internet Protocol security (IPsec) bypass
 * Windows Firewall: Protect all network connections
 * Windows Firewall: Do not allow exceptions
 * Windows Firewall: Define program exceptions
 * Windows Firewall: Allow local program exceptions
 * Windows Firewall: Allow remote administration exception
 * Windows Firewall: Allow file and print sharing exception
 * Windows Firewall: Allow ICMP exceptions
 * Windows Firewall: Allow Remote Desktop exception
 * Windows Firewall: Allow Universal Plug and Plan (UpnP) framework exception
 * Windows Firewall: Prohibit notifications
 * Windows Firewall: Allow logging
 * Windows Firewall: Prohibit unicast response to multicast or broadcast requests
 * Windows Firewall: Define port exceptions
 * Windows Firewall: Allow local port exceptions

For more information about Windows Firewall Group Policy settings, download the following white paper:

Deploying Windows Firewall Settings for Microsoft Windows XP with Service Pack 2

<div class="references_section">