Skip to main content
Hands-on lab

Inspect Windows Firewall and add an inbound block rule

From an elevated Windows command prompt, inspect the firewall rule listing and read each rule's Direction and Action. Then add a named rule that blocks inbound TCP port 23 without changing unrelated traffic. The SOP also shows the modern New-NetFirewallRule equivalent. This lab uses a canned console; it does not change the learner's firewall. Practice, not exam questions. Not a score predictor. Nothing here is taken from any exam.

The steps on this page are free to read. The hands-on lab for this procedure is included with Academy.

Steps

  1. 1

    Run netsh advfirewall firewall show rule name=all and read the Rule Name, Enabled, Direction, and Action fields in the canned excerpt.

  2. 2

    Run netsh advfirewall firewall add rule name="Block Telnet In" dir=in action=block protocol=tcp localport=23. The equivalent PowerShell cmdlet is New-NetFirewallRule with the same name, direction, action, protocol, and local port.

What you should see

The listing shows vertical field blocks for built-in rules, including Direction: In and Action: Allow. The add command prints Ok. for the new inbound TCP port 23 block rule.

Study the concept