Compartilhar via


Firewall Instructions

You must enable several ports or programs in the firewall so that the Windows Communication Foundation (WCF) samples can function. Many of the samples communicate by using ports in the range 8000-8003, and port 9000. The firewall is turned on by default and prevents access to these ports. To enable the firewall for the samples, complete one of the following procedures, depending on your requirements and security environment:

  • Option 1: Interactively enable samples while running. Make no advance changes to your firewall configuration and proceed to start building and running the samples. When a sample is run, a Windows Security Alert dialog box appears. The sample program in question can then be added interactively to an unblocked list. With this procedure, you may have to then restart the sample.

  • Option 2: Enable sample programs in advance. Start the Windows Firewall Control Panel applet and enable the sample programs you plan to run. You must build the programs first so the executable files exist. You can find more detailed instructions in the following procedure.

  • Option 3: Enable a port range in advance. Start the Windows Firewall Control Panel applet and enable ports 80, 443, 8000-8003 and 9000, which are used by the samples. You can find more detailed instructions in the following procedure. This option is less secure than the others because it allows any program to use these ports, not just the samples.

If you are unsure of which procedure to use, choose the first option. If you are running a firewall from another vendor, you might need to make similar changes.

Note

Changing your firewall configuration affects your security. It is recommended that you record the changes you make and remove them when you are finished working with the samples.

To enable samples programs in advance

  1. Build the sample.

  2. Click Start, click Run, and type firewall.cpl. This opens the Windows Firewall Control Panel applet.

  3. On Windows Vista and Windows Server 2008, click Allow a program through Windows Firewall.

  4. On the Exceptions tab, click Add Program.

  5. Click the Browse button and select the executable file of the sample you plan to run.

  6. Repeat steps 3 and 4 until you have added the executable files of all the samples you plan to run.

  7. Click OK to close the firewall applet.

To enable a port range in advance

  1. Click Start, click Run, and type firewall.cpl. This opens the Windows Firewall Control Panel applet.

  2. On Windows Vista and Windows Server 2008, click Allow a program through Windows Firewall.

  3. On the Exceptions tab, click Add Port.

  4. Enter a name, enter port 8000, and select the TCP option.

  5. Click the Change Scope button, select the My Network (subnet) only option, and click OK.

  6. Repeat steps 2-4 for ports 8001, 8002, 8003, 9000, 80 (HTTP), and 443 (HTTPS/SSL).

  7. Click OK to close the firewall applet.

Note

Remove any firewall exceptions when you are finished working with the samples. To do so, open the Windows Firewall Control Panel applet and remove any programs or port entries that were added by the previous procedures.