---
title: "Beginners Guide to the Netsh Command"
description: "Learn how to manage your firewall, troubleshoot your WiFi signal, and even trace network traffic through this ATA Learning tutorial on the netsh command!"
canonical: "https://adamtheautomator.com/netsh-command/"
---

# Beginners Guide to the Netsh Command

> Learn how to manage your firewall, troubleshoot your WiFi signal, and even trace network traffic through this ATA Learning tutorial on the netsh command!

Source: https://adamtheautomator.com/netsh-command/

---

ATA Learning

Tap to hide

[

ATA Learning

](/)

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Search for:  

*   [](https://twitter.com/adbertram)
*   [](https://github.com/Adam-the-Automator)
*   [](https://www.linkedin.com/company/adam-the-automator-llc)
*   [](/feed/)

![Beginners Guide to the Netsh Command](https://adamtheautomator.com/wp-content/uploads/2023/10/netsh-command.jpg)

# Beginners Guide to the Netsh Command

[![](https://secure.gravatar.com/avatar/2788bb1a3f735603f81eca51d68daec56a9d97e805a10268fb2c20afcc76b81b?s=192&d=mm&r=g)Nicholas Xuan Nguyen](https://adamtheautomator.com/author/nicholas-xuan-nguyen/)1 November 20235 min. read

Categories: [IT Ops](/category/it-ops/)

Tags:[Windows](/tag/windows/)

Table of Contents

*   [Prerequisites](#prerequisites)
*   [Listing All Configured Firewall Rules via the netsh Command](#listing-all-configured-firewall-rules-via-the-netsh-command)
*   [Listing Firewall Rules Based on Profiles](#listing-firewall-rules-based-on-profiles)
*   [Disabling and Enabling Firewall Rules](#disabling-and-enabling-firewall-rules)
*   [Blocking and Opening Firewall Ports](#blocking-and-opening-firewall-ports)
*   [Checking the Wi-Fi Signal Strength](#checking-the-wi-fi-signal-strength)
*   [Capturing Network Traffic for Troubleshooting](#capturing-network-traffic-for-troubleshooting)
*   [Conclusion](#conclusion)

Network management has a broad reach, and one misstep can set off a domino effect, creating chaos in all corners of your network. But fear not! With the `netsh` command, you are in control, whether setting up connections, tweaking firewall rules, or troubleshooting network hiccups.

In this tutorial, with the `netsh` command as your trusty sidekick, you will troubleshoot network issues, enhance your system’s security, and fine-tune its performance.

Dive into the world of the `netsh` command and unlock a new level of control over your network!

## Prerequisites

Prepare for some hands-on learning! If you plan to participate actively, make sure to have the following ready to go:

*   A computer running Windows 7+ operating system (OS) – This tutorial uses Windows 10 for demonstrations.
*   PowerShell 5+ installed on your computer – This tutorial uses PowerShell v7.

Related:[PowerShell 7 Upgrade: A Comprehensive Walkthrough](https://adamtheautomator.com/powershell-7-upgrade/)

## Listing All Configured Firewall Rules via the `netsh` Command

With the prerequisites met, you will now delve into a crucial aspect of using the powerful `netsh` command for network security — listing firewall rules.

Firewalls are a network security measure that acts as a barrier between a trusted internal network and an untrusted external network, such as the internet. Thus, listing firewall rules gives you a more transparent understanding of your system’s safeguarding measures.

_**Related: [How To Set Up the UFW Firewall on Linux](https://adamtheautomator.com/ufw-firewall/)**_

To list all current firewall rules, carry out the following:

Open PowerShell as an admin, and run the following `netsh` command.

This command lists (`show`) each `firewall` `rule` (within the `advfirewall` module) configured in your system without specific filtering.

Related:[Run PowerShell as Administrator: Multiple Methods Explored](https://adamtheautomator.com/powershell-run-as-administrator/)

```powershell
netsh advfirewall firewall show rule name=all
```

You will see a comprehensive list of all enabled and disabled firewall rules on your system with their respective names, protocols, profiles, and more, as shown below.

Imagine your computer’s security as a team of digital sentinels, each equipped with precise directives on who is granted access and kept out.

Your firewall monitors incoming and outgoing traffic and allows or blocks specific types of traffic based on these predetermined rules. You would not want your firewall to mistake your cat videos for a cyberattack and send them to digital jail, would you?

![netsh command - Listing all configured firewall rules](https://adamtheautomator.com/wp-content/uploads/2023/10/image-156.png)

Listing all configured firewall rules

## Listing Firewall Rules Based on Profiles

From listing all configured firewall rules, shift your focus to a more targeted approach. Instead of listing everything, list firewall rules based on profiles.

Profile-based firewall rules ensure that different security settings are applied depending on the type of network you are connected to.

Firewall rules are categorized into the following profiles based on their scope:

| Profile | Details |
| --- | --- |
| Domain | This profile is typically used when the computer is connected to a domain network. |
| Private | This profile applies when the computer is connected to a private or home network. |
| Public | This profile is used for public networks such as airports, cafes, and so on. |

Execute the following commands to list the `firewall` rules specific to each profile: `domain`, `private`, and `public`.

```powershell
# Lists firewall rules in domain profiles
netsh advfirewall firewall show rule name=all profile=domain
# Lists firewall rules in private profiles
netsh advfirewall firewall show rule name=all profile=private
# Lists firewall rules in public profiles
netsh advfirewall firewall show rule name=all profile=public
```

The information, as shown below, grants you finer control over your system’s defenses. Moreover, filtered information lets you tailor your security settings to suit specific user or network requirements.

![Listing firewall rules in domain profiles](https://adamtheautomator.com/wp-content/uploads/2023/10/image-157.png)

Listing firewall rules in domain profiles

![Listing firewall rules in private profiles](https://adamtheautomator.com/wp-content/uploads/2023/10/image-158.png)

Listing firewall rules in private profiles

![Listing firewall rules in public profiles](https://adamtheautomator.com/wp-content/uploads/2023/10/image-159.png)

Listing firewall rules in public profiles

## Disabling and Enabling Firewall Rules

Besides listing configured firewall rules, one of the best features the `netsh` command offers is controlling the flow of network traffic. How? By temporarily disabling or reactivating specific firewall rules.

Related:[Disabling Windows Firewall: A Comprehensive Guide](https://adamtheautomator.com/disable-windows-firewall/)

But wait, is disabling firewall rules safe? There may be times when you need to disable a specific firewall rule temporarily. One example is when troubleshooting a network issue or when running a program that is being mistakenly blocked by the firewall.

To see how disabling and enabling firewall rules work:

Run the following command to disable and enable the `Bonjour Service` rule in all profiles.

Ensure you replace the `Bonjour Service rule` with the one you wish to disable or enable.

```powershell
netsh advfirewall firewall set rule name="Bonjour Service" new enable=no
netsh advfirewall firewall set rule name="Bonjour Service" new enable=yes
```

![Disabling and enabling a firewall rule](https://adamtheautomator.com/wp-content/uploads/2023/10/image-160.png)

Disabling and enabling a firewall rule

## Blocking and Opening Firewall Ports

You may find disabling the firewall unnecessary, but you wish to have a hands-on approach to managing your network traffic. In that case, opening and blocking firewall ports will give you the power to fine-tune your system’s communication.

To block or open firewall ports, proceed with the following:

Execute each command below to block and open port `22` (or a different one) in your firewall. Blocking the SSH port lets you prevent brute-force attacks.

```powershell
# Block the port 22
netsh advfirewall firewall add rule name="Block Port 22" dir=in action=block protocol=tcp localport=22
# Open the port 22
netsh  advfirewall firewall add rule name="Open Port 22" dir=in action=allow protocol=tcp localport=22
```

Related:[SSH and PowerShell: Set Up Windows SSH Client](https://adamtheautomator.com/powershell-ssh/)

![Blocking and opening firewall ports](https://adamtheautomator.com/wp-content/uploads/2023/10/image-161.png)

Blocking and opening firewall ports

## Checking the Wi-Fi Signal Strength

As a network administrator, one of your critical tasks is maintaining a robust and reliable network, which starts by checking the Wi-Fi signal strength.

Imagine being responsible for a network that supports a bustling office or a bustling campus. A dip in signal strength could lead to frustrated users, disrupted workflows, and even security concerns.

To check the Wi-Fi signal strength, complete the following:

Run the below `netsh wlan` command to `show` detailed information about the wireless network `interfaces` on your computer.

```powershell
netsh wlan show interfaces
```

Like in the output below, you will see a detailed report of your wireless interface, including its GUID, SSID, channel number, and so on.

Most importantly, you will see your Wi-Fi’s signal strength, which is **89%**. This percentage signifies your network connection’s reliability.

![Checking the Wi-Fi signal strength](https://adamtheautomator.com/wp-content/uploads/2023/10/image-162.png)

Checking the Wi-Fi signal strength

## Capturing Network Traffic for Troubleshooting

Checking your Wi-Fi signal strength is one thing, but you also need a skill that provides invaluable insights when things do not go as planned. At some point, you may need to capture the packets being transmitted and received to understand what might be causing the problem.

To capture network traffic, perform the following steps:

1\. Invoke the below [`New-Item`](https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.management/new-item?view=powershell-7.3) command to create a new folder called _`CapturedData`_ to save captured data.

Related:[A Beginners Guide To PowerShell New-Item](https://adamtheautomator.com/powershell-new-item/)

```powershell
New-Item -ItemType Directory -Path C:\CapturedData
```

![Creating a new folder to store captured data](https://adamtheautomator.com/wp-content/uploads/2023/10/image-166.png)

Creating a new folder to store captured data

2\. Next, run the following command to perform the following:

*   `trace` – Manage network tracing.
*   `start` – Instructs `netsh trace` to begin capturing network traces.
*   `capture=yes` – Specifies that network packets should be captured.
*   `report=no` – Designates whether to generate a summary report after completing the trace. In this case, `no` report will be generated.
*   `correlation=no` – Indicates whether to correlate the captured data with other events. In this example, `no` correlation will be performed.
*   `persistent=yes` – Specifies whether the trace session should be persistent across reboots. In this case, the trace configuration will be saved and applied (`yes`) even after a system restart.
*   `tracefile` _–_ Defines the location and name of the file where the captured network trace data will be stored. In this case, the location is set to `C:\CapturedData\NetworkTrace.etl`.

```powershell
netsh trace start capture=yes report=no correlation=no persistent=yes tracefile=C:\CapturedData\NetworkTrace.etl
```

![Capturing network traces](https://adamtheautomator.com/wp-content/uploads/2023/10/image-165.png)

Capturing network traces

3\. With enough captured data, run the below command to `stop` the capture.

```powershell
netsh trace stop
```

![Stopping the capture](https://adamtheautomator.com/wp-content/uploads/2023/10/image-164.png)

Stopping the capture

4\. Finally, navigate to the folder where you saved the captured data, and you will see the _NetworkTrace.etl_ file.

You can share this file with your network team to help troubleshoot any connectivity issues.

![Verifying the file (NetworkTrace.etl) that contains the captured data](https://adamtheautomator.com/wp-content/uploads/2023/10/image-163.png)

Verifying the file (_NetworkTrace.etl_) that contains the captured data

## Conclusion

Throughout this tutorial, you have learned how to manage firewalls with the `netsh` command expertly, ensuring your network’s security. Plus, you have touched on capturing network traffic, a crucial skill for troubleshooting and maintaining a smoothly running system.

Now, how about delving deeper into networking? Why not explore other tools and strategies like [secure remote access](https://techcommunity.microsoft.com/t5/core-infrastructure-and-security/securing-rdp-with-ipsec/ba-p/259108), virtual private networks (VPNs), and [intrusion detection systems (IDS)](https://www.linkedin.com/pulse/building-your-own-intrusion-detection-system-small-sagar-neupane)?

Keep pushing your boundaries, and remember that the more you practice, the more confident you will become in network management. So, grab the reins and let your networking journey soar to new heights!

Related:[How To Set Up WireGuard VPN on Linux](https://adamtheautomator.com/wireguard-vpn/)

Share this article

[Share on X](https://twitter.com/intent/tweet?url=https%3A%2F%2Fadamtheautomator.com%2Fnetsh-command%2F&text=Beginners%20Guide%20to%20the%20Netsh%20Command)[Share on Facebook](https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fadamtheautomator.com%2Fnetsh-command%2F)[Share on LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fadamtheautomator.com%2Fnetsh-command%2F)

## Related Posts

![](https://adamtheautomator.com/wp-content/uploads/2024/04/idfix.jpg)

### [Solve Azure AD Connect Errors via the Microsoft IdFix Tool](/idfix/)

Fix Azure AD Connect errors fast with the Microsoft IdFix tool—your go-to solution for seamless synchronization and efficient directory management!

![](https://adamtheautomator.com/wp-content/uploads/2024/04/sandboxie.jpg)

### [How to Install Sandboxie on Windows](/sandboxie/)

Secure your Windows system with Sandboxie. Learn how to install this tool hassle-free and safeguard your digital activities!

![](https://adamtheautomator.com/wp-content/uploads/2022/11/How-to-Install-NitroShare-for-Cross-Platform-File-Transfer.jpg)

### [Install NitroShare and Streamline Your File Transfers Today](/nitroshare/)

Simplify cross-platform file transfers with NitroShare. This tutorial guides you through installation and use for fast, effortless file sharing between different operating systems.

## Categories

*   [IT Ops](/category/it-ops/)
*   [Cloud](/category/cloud/)
*   [DevOps](/category/devops/)
*   [Home Ops](/category/home-ops/)
*   [Information Security](/category/infosec/)
*   [Software Development](/category/software-development/)

## Site

*   [Home](/)
*   [Tutorials](/tutorials/)
*   [Instructors](/author/)
*   [Advertising](/advertising/)
*   [Recommended Resources](/resources/)
*   [About Adam](/about-adam/)

Copyright 2026© ATA Learning | [Privacy Policy](/privacy/)
