How to Use Netsh on Windows 11: A Complete, Detailed Guide to Managing and Repairing Your Network

Last update: 09/05/2025
Author Isaac
  • Netsh allows you to modify and diagnose network configuration in Windows 11 from the console.
  • With netsh you can manage IP, DNS, Wi-Fi, firewall and troubleshoot connectivity issues.
  • Its use requires administrator privileges and attention to syntax, but offers quick solutions.

netsh on Windows 11

Have you ever encountered internet problems on your computer and didn't know where to begin troubleshooting? Or perhaps you want to customize your PC's network settings and are looking for a powerful, albeit lesser-known, tool that allows you to do so in an advanced way. If you use Windows 11, the netsh command is one of those essential resources you should know: a Swiss Army knife capable of repairing your connection, modifying parameters, automating tasks, or even exporting and restoring entire network configurations.

In this article, you'll discover once and for all everything you can achieve with netsh in Windows 11, from basic operation to advanced use: essential commands , tricks , tips, real-world examples, and warnings that will save you from more than one headache. We'll explain what netsh is for, how to use it in practice, how to get the most out of each context and command, and, above all, how to use it to solve your network problems at home or in the office.

What is netsh and what is it used for in Windows 11?

Netsh (Network Shell) is a command-line utility available in virtually all modern versions of Windows, including Windows 11. It allows you to view, modify, manage, and diagnose your computer's network configuration, both locally and remotely.

The Windows Control Panel only allows you to make basic adjustments. However, with netsh, you can do much more. It's the preferred tool for administrators, technicians, and advanced users because it lets you automate tasks, create scripts, troubleshoot complex network issues, and customize settings in granular detail (Wi-Fi, IP, firewall, DNS, TCP/IP, network bridges, and more). Here's how to manage IP addresses on your network.

Netsh works directly in CMD ( command prompt ) or PowerShell , so you need to open the terminal as an administrator to run most commands that change system settings.

Advantages and disadvantages of netsh

Why use netsh? These are the main advantages :

  • Power and flexibility: You can configure, audit, and restore almost any network parameter.
  • Automation: Supports scripts and batch files, ideal for professional environments.
  • Diagnosis and repair: It allows you to solve problems that cannot be fixed from the graphical interface.
  • No external tools required: It is included by default in Windows.
  • Allows you to export/import configurations: Useful for backing up or cloning settings between computers.

But it also has drawbacks and limitations to keep in mind:

  • It's not very intuitive: Its use requires a good knowledge of the syntax and the exact commands, which can be tricky for starters.
  • Without graphical interface: Everything is managed by commands; a typing error can invalidate an order.
  • Prone to user errors: A misplaced parameter can change the configuration in an unintended way.
  • Administrator access: It is essential to run the console with elevated privileges for most useful commands.
  • Limitations in modern networks: Some recent advanced features (e.g., SDN, certain IPv6 options) are not fully supported.
  How to fix frequent disconnections with Intel Wi-Fi 6 AX201 in Windows 11

How to access and run netsh on Windows 11

There are two main ways to use netsh: from PowerShell or from CMD (Command Prompt) . Although the behavior is similar, there are slight differences in the syntax for some commands. Using the Command Prompt is recommended for most examples.

  • Open CMD as administrator: Balance Win + R, writes cmd, and then press Ctrl + Shift + Enter. Confirm permission if requested.
  • Open PowerShell as administrator: Search for “Windows PowerShell” in the Start menu, right-click, and select “Run as administrator.”

Once the console is open, you can start using netsh by simply typing:

netsh

This will take you to the Netsh shell. If you want to run a command directly, you can do so like this:

netsh command-o-context parameters

General syntax and netsh parameters

The syntax for netsh is simple but very strict. A basic command typically has the following structure:

netsh

Main global parameters:

  • -a AliasFile: Executes the commands in an alias file and returns to netsh.
  • -c Context: Switches to the specified context (e.g., "wlan").
  • -r RemoteEquipment: Run the command on a remote computer (requires having the remote registry service active on the target).
  • -u User: Run the command using another user's credentials.
  • -p Password: Provides the password for the specified user with -u.
  • -f ScriptFile: Execute a file script from netsh and exits when finished.

A quick help query can be made with:

netsh /?

Contexts and subcontexts in netsh

One of the key concepts in netsh is "context." Each context is a specific area of ​​the network configuration: for example, "interface," "wlan," "advfirewall," "bridge," "winhttp," etc. Within each context, you'll find specialized commands and subcontexts for managing different functionalities.

Some of the main contexts you can use in Windows 11 are:

  • interface: General configuration of network interfaces (IP, DNS, etc.).
  • wlan: Control and diagnosis of Wi-Fi networks.
  • advfirewall: Advanced firewall management.
  • bridge: Creating and managing network bridges.
  • winhttp: System-level HTTP proxy configuration.
  • dhcpclient, dnsclient, http, ipsec, ras, rpc, lan, trace, wfp, winsock: Other contexts for specific tasks.

To see all available contexts run:

netsh /?

And to consult the commands of a specific context:

netsh ?

Most commonly used Netsh commands in Windows 11 for network repair

The most popular use of netsh is to troubleshoot common internet connectivity problems. When the network goes down, Wi-Fi won't connect, there are IP conflicts, or DNS issues arise, these commands are often the first line of defense:

  • netsh winsock reset: Restores the Winsock catalog, resolving connectivity issues resulting from socket corruption or misconfiguration.
  • netsh int ip reset: Restores the TCP/IP stack to its original factory settings, ideal for troubleshooting rare IP conflicts.
  • netsh advfirewall reset: Resets all Windows Firewall rules to default.
  How to use the Instagram "What nationality are you" filter. iOS and Android

Combined with ipconfig /flushdns , ipconfig /release and ipconfig /renew (which renew DNS and IP), they form the "emergency kit" for the internet that any user should know.

To use them:

  1. Open the console as administrator.
  2. Execute the commands one by one: enter each one and press Enter.
  3. Restart the computer if you use netsh winsock reset or netsh int ip reset (the console itself will tell you if necessary).

Recommended order of execution:

ipconfig /flushdns ipconfig /release ipconfig /renew netsh winsock reset netsh int ip reset netsh advfirewall reset

This order helps rule out DNS caching issues, IP conflicts, or firewall restrictions.

How to use netsh to export, save, and restore network settings

One of netsh's lesser-known but most useful features is the ability to export your network configuration to a plain text file. This way, if your configuration is working perfectly, you can create a backup to restore it in case of unwanted changes or errors.

Steps:

  1. Create a backup folder (for example, C:\networks).
  2. Save the current settings:
    netsh dump > C:\redes\configuration.txt
  3. To restore:
    netsh -f C:\redes\configuration.txt

This process is quick and very effective for users who experience frequent network changes or for administrators managing multiple computers.

Related articles:
How to find and manage valid IP addresses on your network

Manage network interfaces, IP addresses, and DNS with Netsh

Netsh allows you to view and modify the configuration of each network interface (wired or Wi-Fi). These commands are applied in the "interface" context and are very useful for changing from dynamic to static IP addresses, modifying DNS servers, or simply checking the status of the interfaces.

  • Show available interfaces:
    netsh interface show interface
  • Query the IP and DNS of an interface:
    netsh interface ipv4 show address "Wi-Fi" netsh interface ipv4 show dns "Wi-Fi"
  • Change IP to static:
    netsh interface ipv4 set address "Wi-Fi" static 192.168.1.40 255.255.255.0 192.168.1.1 1
  • Put the IP in dynamic mode (DHCP):
    netsh interface ipv4 set address "Wi-Fi" dhcp
  • Set a fixed DNS:
    netsh interface ipv4 set dnsservers "Wi-Fi" static 8.8.8.8 validate=no
  • Set DNS to automatic mode:
    netsh interface ipv4 set dnsservers "Wi-Fi" dhcp

These commands must be adjusted according to the name of your network adapter (replace "Wi-Fi" with the appropriate name, which you can see with the first command in the list).

Advanced wireless network management and diagnostics (Wi-Fi) with netsh

Netsh is especially useful for controlling advanced aspects of Wi-Fi:

  • View saved wireless network profiles:
    netsh wlan show profiles
  • Prevent automatic connection to a Wi-Fi network:
    netsh wlan set profileparameter name="Network name" connectionmode=manual
  • Allow automatic connection:
    netsh wlan set profileparameter name="Network name" connectionmode=auto

With these commands, you can precisely control which networks your laptop or computer connects to, and you can clean up old or unwanted profiles.

  How to reset permissions for all apps on Android

Configuring and Managing the Firewall with Netsh AdvFirewall

The advfirewall context has replaced the older netsh firewall, offering more advanced control. From here you can create, modify, and delete Windows firewall rules, adjusting incoming and outgoing traffic for programs, services, and ports.

Examples of useful commands:

  • Open port 80 (HTTP):
    netsh advfirewall firewall add rule name="Open Port 80" dir=in action=allow protocol=TCP localport=80
  • Delete a rule (by name):
    netsh advfirewall firewall delete rule name="Open Port 80"
  • Restore the firewall to default settings:
    netsh advfirewall reset
  • Enable the firewall for a profile:
    netsh advfirewall set currentprofile state on

Commands for managing and diagnosing network bridges (netsh bridge)

If you need to connect multiple network interfaces together (for example, to share Internet access between LAN and Wi-Fi), netsh allows you to manage “bridges.”

Main commands in the bridge context:

  • List existing bridges:
    netsh bridge list
  • See available adapters for bridge:
    netsh bridge show adapter
  • Create a bridge between two adapters (using index or name):
    netsh bridge create 1 4 netsh bridge create "Wi-Fi" "Ethernet"
  • Add an adapter to an existing bridge:
    netsh bridge add to
  • Removing an adapter from the bridge:
    netsh bridge remove from
  • Destroy the bridge and remove all linked adapters:
    netsh bridge destroy

These are advanced commands, recommended only if you are clear about the objective, as they can leave you without network access if used incorrectly.

Configure and manage system HTTP proxies with netsh winhttp

Netsh winhttp is the specific context for global proxy configuration (at the system level, not just for the browser), something widely used in corporate or teleworking environments.

Common commands:

  • Set proxy:
    netsh winhttp set proxy proxy-server="http=proxy-server;https=secure-proxy" bypass-list="*.mydomain.com"
  • Import proxy settings from Internet Explorer:
    netsh winhttp import proxy source=ie
  • Reset proxy settings:
    netsh win http reset proxy
  • Show current settings:
    netsh winhttp show proxy

You can also define advanced proxies in JSON format or apply different configurations per user/machine.

Export, import, and automate tasks with Netsh scripts

One of netsh's strengths is its ability to work with scripts . You can save your commands in text files and run them in batches with the -f parameter.

netsh -f path\file.txt

This is ideal for replicating configurations, deploying settings to multiple computers, or performing quick tests. You can also use the netsh dump output to create periodic automatic backups.