How to manage networks and WiFi with commands in Windows 11

Last update: 23/02/2026
Author Isaac
  • Windows 11 allows you to manage networks and WiFi both with commands (CMD and netsh) and from the graphical interface, covering everything from basic to advanced tasks.
  • Tools such as ping, ipconfig, netstat, tracert, pathping, nslookup, or netsh are key to diagnosing, configuring, and automating the network.
  • The system includes features to change IP, restart adapters, create WiFi access points, forget networks, limit data usage, and prioritize WiFi/LAN connections.
  • With a good combination of commands, Network and Internet settings, and good security practices, you can have almost total control over connectivity in Windows 11.

Manage networks with commands in Windows 11

If you use Windows 11 in a basic way, the graphical interface is probably more than enough to connect to Wi-Fi, browse the web, and little else. But as soon as you want diagnose network failures, optimize WiFi, or automate tasksThings change: that's where the commands and the advanced networking tools.

In Windows 11 you can manage virtually everything related to connectivity from the Command Prompt (CMD), PowerShell, and the Network and Internet settings panelFrom checking your connection and tracking your data packets to changing your IP address, restarting interfaces, and even creating a Wi-Fi access point and generating detailed network reports, we'll explore it all in detail.

What is CMD and why is it still key for networking in Windows 11?

CMD is the classic Windows command-line interface, successor to the old MS-DOS. It allows you to execute text commands to control almost any aspect of the system: files, processes, configuration and, of course, everything related to the network.

Although Windows 11 has a very user-friendly graphical interface, the command prompt (and PowerShell as well) remains essential for system administrators, technicians, developers, and advanced usersbecause many operations are done faster, more accurately and, above all, more automatably this way.

In addition to individual commands, CMD allows you to execute batch scripts (.bat or .cmd) that chain together commands: moving files, changing configurations, making backups, or adjusting the network unattended. It's an extremely powerful tool, but also dangerous if you're not careful, because There are commands capable of breaking the system or deleting data. if they are used without knowledge.

In the realm of networking, CMD and netsh offer an arsenal of options to view IPs, check connectivity, trace routes, measure latency, configure WiFi, tweak the firewall, reset TCP/IP, or generate very comprehensive diagnostic reports. The learning curve is somewhat steeperBut once you've internalized the basic commands, management is much more agile than navigating through menus.

Basic commands for diagnosing networks in Windows 11

The first layer of working with networks in Windows 11 involves handling a few essential commands for find out what's happening with your connectionWith them you can check if there is connectivity, what IP you have, how a domain is resolved, or what routes your packets follow.

ping: check if a device responds

The command ping It's used to check if a host (IP or domain) is reachable and how long it takes for packets to travel to and from it. It's ideal for an initial check when something isn't working properly with the network.

Basic usage to check if the local router is responding:

ping 192.168.1.1

Each execution sends 4 ICMP packets By default, it returns round-trip times in milliseconds. If the destination responds successfully, you'll see messages like "Reply from XXXX"If something goes wrong, warnings will appear such as "Destination host inaccessible" o "This request has timed out".

Some useful ping parameters in Windows 11 are key to more refined connectivity tests:

  • ping 192.168.1.1 -n 100 → sends 100 packages instead of 4.
  • ping 192.168.1.1 -w 3000 → Increases the maximum waiting time to 3000 ms.
  • ping 192.168.1.1 -t → keeps the ping indefinitely until you press Ctrl+C.

You can also ping domains, not just IPs. If you ping a a domain returns a responseIn addition to connectivity, you also have functional DNS resolution.

ipconfig: View and control IP configuration

With ipconfig You can see the configuration of all network adapters at a glance: IP address, subnet mask, gateway, DNS, and moreIt's one of the commands you'll use most often.

To see all the details, the typical thing to do is:

ipconfig /all

In addition to displaying information, ipconfig allows some basic maintenance actions that can save you when the Internet goes "dumb" due to a naming problem.

For example, for Empty the Windows DNS cache you can run:

ipconfig /flushdns

This deletes the name records that the system has stored. It's very useful when there are domain resolution problems (for example, you change DNS or a site has changed its IP address) and the computer continues to use old information.

nslookup: inspect DNS resolution

The command nslookup It is designed to be consulted in detail. relationship between domains and IPsIn other words, it allows you to directly ask the DNS servers what address a hostname has or, conversely, what name corresponds to an IP address.

More direct use, in non-interactive mode:

nslookup www.ejemplo.com

You can also start it without arguments to enter interactive modewhere you run queries one after another, changing the record type, the DNS server, etc. It's a very powerful tool for diagnose DNS problems when a domain resolves on one computer but not another, or when you suspect a failure on a specific server.

netstat: open connections and ports

The command netstat It is used to list the active connections and listening ports on your computer. It's very useful both for seeing which program is using a port and for checking if there are services that shouldn't be open.

For example, a common call is:

netstat -ano

With that combination you see the connections, the status (ESTABLISHED, LISTENING, etc.), the local/remote addresses, and the Process ID (PID)By cross-referencing that PID with the Task Manager, you can identify which application is behind each port.

tracert and pathping: knowing where your packets are going.

If you want to know why traffic goes through routers and hops To reach a destination, the command you're looking for is tracertIt is responsible for displaying each intermediate hop and the corresponding latency.

Simple example:

tracert www.ejemplo.com

You'll see a numbered list of jumps, with three times per jump (three ICMP probes) and the IP address or name of each node. It's perfect for pinpointing where along the route latency spikes or traffic is lost.

  Discover all the functions and possibilities of your router's USB port

If you need to go further, you have PathPing, which combines what tracert does with a kind of prolonged ping at each hop to Measure packet loss and route-by-route stabilityThe analysis takes a little longer because it sends quite a few messages to each router, but the final summary clearly shows you which segment is losing traffic.

It's advisable to take certain precautions with pathping: Don't overuse pings To avoid congestion, carefully check the capitalization in the parameters and remember that it will only work if the device has TCP/IP installed on the adapter.

Advanced commands for managing networks and WiFi in Windows 11

Beyond the basics, Windows 11 includes a good number of commands designed for manage wired and wireless networks and the firewall in a fairly professional manner. This is where netsh, getmac, and the like come into play.

netsh: the all-rounder of network configuration

The command netsh (Network Shell) In practice, it's a network management console within CMD. It works based on... contexts (firewall, interface, WLAN, IP, etc.) and allows you to do almost everything: adjust IP parameters, manage Wi-Fi profiles, configure the firewall, run diagnostics, or export configurations to scripts. If needed, you can disable automatic connection in Windows 11 from the graphical interface.

Typical examples focused on WiFi:

  • View all saved wireless profiles:
    netsh wlan show profiles
  • Display the data for a specific profile:
    netsh wlan show profile "NombreRed"
  • Preventing a WiFi network from connecting automatically (manual mode):
    netsh wlan set profileparameter name="NombreRed" connectionmode=manual
  • Return to automatic connection:
    netsh wlan set profileparameter name="NombreRed" connectionmode=auto

You can also use netsh Reset the TCP/IP stack, the firewall, and Winsock. and other network components when everything starts failing for no apparent reason. A set of commonly used commands after a network reset would be:

  • netsh int tcp set global autotuninglevel=disable
  • netsh int ip reset
  • netsh advfirewall reset
  • netsh winsock reset
  • ipconfig /flushdns
  • ipconfig /release
  • ipconfig /renew

In addition, netsh allows Change static IP addresses from CMDThe typical flow would be:

  • View interface configuration:
    netsh int ipv4 show config
  • Assign IP address, subnet mask, and gateway to a specific interface:
    netsh int ipv4 set address name="NombreInterfaz" static 10.0.0.5 255.255.255.0 10.0.0.1
  • Configure DNS for that interface:
    netsh int ipv4 set dns name="NombreInterfaz" static 10.0.0.1
    netsh int ipv4 add dns name="NombreInterfaz" 10.0.0.2 index=2

getmac: view the MAC addresses of your interfaces

With the command getmac you can quickly list the physical addresses (MAC) of all the device's interfaces, both connected and disconnected. This is useful for MAC filtering on the router, inventory control, or simply for identifying adapters.

It supports additional parameters, for example:

  • getmac /fo table → displays the results in table format.
  • getmac /nh → hides column headers.

hostname, arp, nbtstat, net use and other useful network commands

There is a set of smaller but very practical commands for specific network management tasks in Windows 11:

  • hostname: shows the name of the team on the network. Very useful when you need to locate a machine without knowing its IP address.
  • arp: allows you to view and modify the ARP tablewhich links IPs to physical Ethernet addresses. With arp -a You can see the current entries.
  • nbtstat: displays statistics and tables of names of NetBIOS over TCP/IPIt helps diagnose name resolution problems on Windows local networks.
  • net use: classic command for connect and disconnect shared resources (folders, printers) on a network. For example:
    net use Z: \\servidor\carpeta /user:DOMINIO\usuario (more in) Credential manager)
  • taskkillThis allows you to terminate local or remote processes from the command line, useful when a network service hangs. For example:
    taskkill /PID 1234 /F
  • shutdown: is used for shut down or restart remote equipmentprovided you have permissions:
    shutdown /r /m \\equipo /t 0
  • telnetA very old client for connecting to Telnet servers. In Windows 11 you need to First install the Telnet client from Optional Features if you want to use it.

Using Network and Internet settings in Windows 11

While commands are essential for many tasks, Windows 11 includes a panel of Network and Internet Settings Very comprehensive. From there you can make most changes without using CMD, and it's often more convenient for everyday use.

To enter you can:

  • Ir a Home > Configuration > Network and Internet.
  • Or right-click on the network icon (Ethernet or WiFi) in the taskbar and choose Network and Internet Settings.

At the top you will see the connection status (if you have internet, network type, data usage, etc.). From there you can access Wi-Fi, Ethernet, VPN, data usage, airplane mode and advanced settings.

View the IP address from the interface

If you don't want to use ipconfig, you can check your IPv4 address from the graphical configuration:

  1. Go to Settings> Network and Internet.
  2. Choose Wi-Fi (if you're using wireless) and then your connected network, or Ethernet if you use cable.
  3. In the block of Properties You will see the IP address next to "IPv4 Address".

Configure public or private network

The first time you connect to a network, Windows 11 marks it by default as actYou can switch between public and private from the same network screen:

  1. Opens Settings> Network and Internet and select Wi-Fi or Ethernet, as appropriate.
  2. Click on the network you are connected to.
  3. En Network profile type, choose Public (recommended) o Private depending on whether you trust the network or not.

On public networks the team hidden from other devices to reduce risks. On private networks (your home, for example) the PC can share files and printers.

Change TCP/IP and DNS (including DNS over HTTPS)

If you need to change a static IP address or manually configure DNS, you can do so without using netsh:

  1. Go to Settings> Network and Internet.
  2. On Wi-Fi, enter Manage known networks and select the one you want; in Ethernet, tap on the connected network.
  3. Beside IP Assignment click on Edit.
  4. Choose between Automatic (DHCP) o ManualIn manual mode you can enter IP address, subnet mask, gateway, and DNS manually.

For DNS you can activate DNS over HTTPS (DoH), automatically or by specifying a manual template, and decide whether to allow reverting to plain text when the query cannot be encrypted.

Limit data and airplane mode

Windows 11 can help you control data usageespecially if you use a 4G/5G dongle or share your mobile internet: you can also activate the data saving mode to reduce background consumption.

  1. Opens Settings> Network and Internet.
  2. On the connected network, enter Use of data.
  3. Press on Enter limit and defines the type of limit, period, and amount of data.
  How to see the Earth from space with Google Earth and Maps

When you approach that limit, the system will warn you. And if you want to cut off all wireless communications at once, you can. activate airplane mode from the quick panel or from Network and Internet > Airplane Mode.

Fine-tuned WiFi control: auto-connection, profiles, and priorities

Windows 11 tends to automatically connect to saved Wi-Fi networks, which is convenient but sometimes impractical: you can end up right next to a repeater with a weak signal or connected to a poor-quality public network. It's advisable master WiFi profiles to decide what you connect to and what you don't.

Prevent Windows 11 from constantly searching for WiFi networks

On laptops, having WiFi constantly scanning for networks can be risky not only if you connect to just anything, but also drains batteryOne advanced technique involves changing the behavior of the WLAN automatic configuration service:

  1. Opens services.msc (Services) from Run (Win+R).
  2. Locate the service Automatic WLAN configuration.
  3. Right-click, then click on Stop and then go to Properties.
  4. Change the startup type of Automatic a Manual, apply and accept.

Since then, Windows will not scan for WiFi networks in the background until you reactivate the service or switch back to automatic startup. It's a fairly drastic adjustment, intended for very specific scenarios.

Prevent it from automatically connecting to a specific network (from the GUI)

If you just want the PC Stop connecting to a specific WiFi networkThe simple way is:

  1. Go to Start > Settings > Network & Internet > Wi-Fi.
  2. Sign in Manage known networks.
  3. Find the problematic network, click on it, and then press on Stop remembering.

By doing this, Windows 11 Delete your profile on that network (including the password) and it won't reconnect automatically. If you ever want to use it again, you'll have to enter the password again.

Disable automatic WiFi connection from the Control Panel

Another more classic and granular way to prevent automatic connection to the current WiFi is:

  1. Opens Control Panel > Network and Internet > Network and Sharing Center.
  2. Click on Change adapter settings.
  3. Double-click on your active WiFi network and then tap on Wireless properties.
  4. In the Connection, uncheck Connect automatically when this network is within range.

From there, that network It will only connect when you do it manually., without affecting the rest of the saved profiles.

Manage WiFi auto-connection from CMD with netsh

If you prefer to do it from command line, you can use netsh to view and modify wireless profiles:

  • View saved profiles:
    netsh wlan show profiles
  • Configure a profile for manual connection:
    netsh wlan set profileparameter name="NombreRed" connectionmode=manual
  • Return to automatic connection:
    netsh wlan set profileparameter name="NombreRed" connectionmode=auto
  • Check the details of a profile and see if it is set to automatic or manual:
    netsh wlan show profile "NombreRed"

The output of that last command will show you if that WiFi is configured for "connect automatically" or "connect manually".

Prioritize Ethernet over WiFi and automatic disconnection

Often you have a laptop that connects via both Wi-Fi and cable. The normal thing is to want it to, When you plug in the Ethernet cable, that connection is the one that sends the command. and WiFi remains in the background or is even turned off.

Disable WiFi when using LAN via group policy

In Pro/Enterprise editions you can use the Local Group Policy Editor (gpedit.msc) to change the behavior when there is a domain network:

  1. Press Win+R, type gpedit.msc and press Enter.
  2. Navigate to Computer Configuration > Administrative Templates > Network > Windows Connection Manager.
  3. Find the directive "Prohibit connections to non-domain networks when connected to a network with an authenticated domain".
  4. Open it, mark it as Enabled and apply the changes.

This option is intended for domain environments, but it reflects how WiFi versus LAN behavior can be automated at the policy level.

Change adapter priority from Device Manager

Another alternative is to take advantage of the advanced adapter options (depends on the driver):

  1. Opens Device administrator (devmgmt.msc).
  2. Expand Network adapters and open the properties of your Ethernet card.
  3. Go to the tab Advanced and look for something like Priority and VLAN or similar.
  4. Activate it or adjust it as the controller allows.

In some drivers, this helps the system give preference to the cable versus WiFi as soon as both are active. In any case, you can also disable WiFi directly when connecting the cable if you prefer a more thorough solution.

Enabling, disabling, and deleting WiFi networks in Windows 11

There are situations where what interests you is completely disable the WiFi adapteror clean up saved networks that you no longer use and that could cause connection problems.

Disable the WiFi adapter from Settings

One way to "turn off" WiFi at the system level (as if you were unplugging the module) is:

  1. Ir a Home > Configuration > Network and Internet.
  2. OPEN Center network and sharing (in Advanced Network Settings or from Control Panel).
  3. Walk into Change adapter settings.
  4. Locate the wireless adapter, right-click and choose Deactivate.

In seconds you'll see the Wi-Fi icon disappear and no more networks available. When you want to get it back, return to the same point and choose Activate.

Disable WiFi from Device Manager

Another way, somewhat more technical but equally valid, is:

  1. OPEN Device administrator.
  2. Ir a Network adapters.
  3. Right-click on your WiFi adapter and choose Disable device.

To restore wireless connectivity, you just need to re-enable the deviceIt's the same idea, just changing the entry point.

Disable WiFi using commands with netsh

If you prefer to do it without leaving CMD, you can use netsh to disable an interface of a specific network:

  1. Open CMD as administrator.
  2. Check the active WiFi interfaces:
    netsh wlan show interfaces
  3. Identify the interface name (for example, "Wi-Fi").
  4. Run:
    netsh interface set interface name="Wi-Fi" admin=DISABLED

When you want to reactivate it, simply change DISABLED by ENABLED:

netsh interface set interface name="Wi-Fi" admin=ENABLED

Forget saved WiFi networks

Over time, saved networks accumulate that you no longer need and can cause problems. failed connection attempts or conflicts. You can learn to Block or hide WiFi networks and manage them graphically:

  1. Go to Start > Settings > Network & Internet > Wi-Fi.
  2. Press on Manage known networks.
  3. Locate the network you want to delete and click on Stop remembering.

Once forgotten, that network It will not reconnect on its own.If you ever find yourself under their coverage again, you will need to enter the password again.

Create, share, and diagnose WiFi networks from Windows 11

Windows is not limited to connecting to existing networks. It is also capable of Create WiFi access points, share the connection, and generate highly detailed diagnostic reports about how your wireless adapter works.

  How to Fix Firefox Failed to Load XPCOM

Create WiFi profiles manually

Sometimes you might want to create a Wi-Fi profile manually (for example, for a network that isn't broadcasting its SSID). In Windows 11, you can do this from two places: Modern Settings or the old Control Panel.

From Settings:

  1. Go to Settings > Network and Internet > Wi-Fi.
  2. Sign in Manage known networks.
  3. Press on Add a new network.
  4. Introduce network name, security type, password And if you want it to connect automatically.

From Control Panel:

  1. Opens Control Panel > Network and Internet > Network and Sharing Center.
  2. Click on Set up a new connection or network.
  3. Choose Manually connect to a wireless network.
  4. Fill in SSID, security, key, and connection behavior.

In both cases you are creating a Full WiFi profile which will be saved and ready for use as soon as the network is available.

Turn Windows 11 into a WiFi hotspot

If you need to share your PC's connection with other devices, you can turn it into a access point (hotspot) using netsh, provided the adapter supports it.

First, check if your card supports hosted networking:

netsh wlan show drivers

In the output, look for the "Hosted Network Supported" line and make sure it says YesIf it says No, that adapter is not suitable for this use.

To create the access point:

  1. Open CMD as administrator.
  2. Define SSID and password for the shared network:
    netsh wlan set hostednetwork mode=allow ssid=MiWifiCompartida key=ContraseñaFuerte123
  3. The hosted network starts up:
    netsh wlan start hostednetwork

Next, you need to go to your internet connection properties (for example, Ethernet), and enter the tab of Shared use and mark "Allow users on other networks to connect through this device's internet connection", selecting the hosted network interface as the destination.

Note that in recent versions of Windows, Microsoft has been replacing this functionality with the option Mobile wireless coverage area in Settings, which greatly simplifies the process.

Generate a detailed report of the WiFi adapter

When there are intermittent outages, strange drops, or problems that are difficult to reproduce, it's very useful to generate a WLAN report which summarizes events, sessions, and errors of the wireless adapter.

To create it:

  1. Open CMD as administrator.
  2. Run:
    netsh wlan show wlanreport
  3. Wait for it to finish; at the end it will indicate the report's path, usually something like:
    C:\ProgramData\Microsoft\Windows\WlanReport\wlan-report-latest.html
  4. Open that file in your browser.

The report includes a time graph with connections and disconnections, power changes, periods with or without Internet, plus a series of sections with detailed information: system versions, adapters, output of commands such as ipconfig or netsh, WiFi profiles used, session statistics and events with their error codes.

With that information you can detect failure patternsCheck if the disconnections are due to a weak signal, power issues, authentication errors, or router outages.

Troubleshooting common WiFi problems in Windows 11

No matter how finely configured your network is, at some point you'll have to struggle with connection errors, networks that disappear, passwords that are not requested or unusual netsh commands. Knowing a few standard procedures helps a lot.

WiFi adapter not detecting networks

When Windows 11 stops seeing WiFi networks, it's usually due to damaged drivers, disabled services, or corrupted system filesSome recommended actions are:

  • Check in Device Manager > Network Adapters if WiFi appears and if there are warning icons.
  • Disable and re-enable the adapter, or directly uninstall it and look for hardware upgrades.
  • use option Reset network in Settings > Network & Internet > Advanced network settings > Reset network.
  • After the reset, run the series of netsh and ipconfig commands discussed earlier and restart.

Errors 0x2 and 0x5 when generating the WLAN report

When using netsh wlan show wlanreport Sometimes errors appear such as 0 x 2 o 0 x 5 and the report isn't generated. Two tricks that usually fix it:

  • Run before:
    netsh wlan show networks
    netsh wlan show interfaces
    and then try the wlanreport again.
  • In the case of error 0x5, open CMD as administrator and run:
    chkdsk C: /f
    To check and correct disk errors, restart and try again.

Windows 11 does not ask for the WiFi password

There are times when, when trying to connect to a network, the system It doesn't even ask for the password. or it gets stuck in the attempt. Some typical checks:

  • Restart both the router like the equipment (actually turned off, waiting about 30 seconds on the router).
  • Update WiFi adapter drivers from Device administrator.
  • Disabling and enabling the adapter is a quick way to reset it.
  • Forget the network from Manage known networks and reconnect by entering the password.
  • Have a good time antivirus or an anti-malware scanner in case any harmful software is interfering. Also check how detect fake WiFi networks and protect your connection.
  • As a last resort, use the Network reset to reset the entire network stack.

The WiFi keeps appearing and disappearing.

If you see the SSID coming and going, or the connection dropping randomly, it's usually a symptom of Poor coverage, interference, outdated drivers, or router problemsSome sensible measures are:

  • Review the physical location from the router and try other bands or channels (especially at 2,4 GHz).
  • Update both the router firmware such as WiFi drivers on the PC.
  • Forget and recreate the WiFi profile, in case it has become corrupted.
  • Use repeaters, powerline adapters, or mesh Wi-Fi systems when there are many walls or long distances. You can also limit bandwidth usage to prioritize traffic.

With all of the above, combining commands such as ping, ipconfig, netsh, tracert or pathping With Windows 11's Network and Internet settings, you can have complete control over your system's connectivity: you can detect problems, adjust WiFi and cable, change IP and DNS, prioritize interfaces, share your connection, clear saved networks, and generate advanced reports when needed, without relying on external tools and with a level of control that most users don't even suspect exists.

network connection flow
Related article:
Network connection flow in Windows 11 and networks: a complete guide