Situatie
This type of rule allows any program that listens on a specified TCP or UDP port to receive network traffic sent to that port. To create an inbound port rule:
- Open the Windows Firewall with Advanced Security console
- In the navigation pane, select Inbound Rules
- Select Action, and then select New rule
- On the Rule Type page of the New Inbound Rule Wizard, select Custom, and then select Next
Although you can create rules by selecting Program or Port, those choices limit the number of pages presented by the wizard. If you select Custom, you see all of the pages, and have the most flexibility in creating your rules.
- On the Program page, select All programs, and then select Next
This type of rule is often combined with a program or service rule. If you combine the rule types, you get a firewall rule that limits traffic to a specified port and allows the traffic only when the specified program is running. The specified program cannot receive network traffic on other ports, and other programs cannot receive network traffic on the specified port.
- On the Protocol and Ports page, select the protocol type that you want to allow. To restrict the rule to a specified port number, you must select either TCP or UDP. Because this is an incoming rule, you typically configure only the local port number If you select another protocol, then only packets whose protocol field in the IP header match this rule are permitted through the firewall.
To select a protocol by its number, select Custom from the list, and then type the number in the Protocol number box.
When you have configured the protocols and ports, select Next. - On the Scope page, you can specify that the rule applies only to network traffic to or from the IP addresses entered on this page. Configure as appropriate for your design, and then select Next
- On the Action page, select Allow the connection, and then select Next
- On the Profile page, select the network location types to which this rule applies, and then select Next
If this GPO is targeted at server computers running Windows Server 2008 that never move, consider modifying the rules to apply to all network location type profiles. This prevents an unexpected change in the applied rules if the network location type changes due to the installation of a new network card or the disconnection of an existing network card’s cable. A disconnected network card is automatically assigned to the Public network location type.
- On the Name page, type a name and description for your rule, and then select Finish
Create an outbound port rule
By default, Windows Firewall allows all outbound network traffic, unless it matches a rule that prohibits the traffic. This type of rule blocks any outbound network traffic that matches the specified TCP or UDP port numbers. To create an outbound port rule:
- Open the Windows Firewall with Advanced Security console
- In the navigation pane, select Outbound Rules
- Select Action, and then select New rule
- On the Rule Type page of the New Outbound Rule wizard, select Custom, and then select Next
Although you can create rules by selecting Program or Port, those choices limit the number of pages presented by the wizard. If you select Custom, you see all of the pages, and have the most flexibility in creating your rules.
- On the Program page, select All programs, and then select Next
- On the Protocol and Ports page, select the protocol type that you want to block. To restrict the rule to a specified port number, you must select either TCP or UDP. Because this rule is an outbound rule, you typically configure only the remote port number If you select another protocol, then only packets whose protocol field in the IP header matches this rule are blocked by Windows Defender Firewall. Network traffic for protocols is allowed as long as other rules that match don’t block it. To select a protocol by its number, select Custom from the list, and then type the number in the Protocol number box. When you’ve configured the protocols and ports, select Next
- On the Scope page, you can specify that the rule applies only to network traffic to or from the IP addresses entered on this page. Configure as appropriate for your design, and then select Next
- On the Action page, select Block the connection, and then select Next
- On the Profile page, select the network location types to which this rule applies, and then select Next
- On the Name page, type a name and description for your rule, and then select Finish.
Leave A Comment?