Sharing Wi-Fi from a Laptop via CMD: A Complete Guide for Windows 10 and 11

You can turn your laptop into a full-fledged Wi-Fi access point without any third-party programs – just a few commands in CMD and the correct system settings. This method is especially useful when you don't have a router handy and need to share internet access with a smartphone, tablet, or another computer. But why the command line and not the standard Windows "Mobile Hotspot"?

It's all about flexibility: through netsh You control the network name, password, Wi-Fi channel, and even the encryption type. This method often works when the Windows graphical interface refuses to create an access point due to an "unknown error." However, there are pitfalls, from driver conflicts to antivirus blocking. This article provides a step-by-step solution to common problems and signal optimization.

If you've never used the command line before, don't worry. We'll cover all the commands in detail, with explanations of each parameter. And for those who prefer visual tools, there's a comparison with alternative methods (including PowerShell and third-party utilities) at the end of the article.

Preparing your laptop: What to check before setting it up

Before running any commands, make sure your laptop is technically capable of distributing Wi-Fi. Here are the key points:

  • 🔄 Wi-Fi adapter must support the regime Hosted Network (virtual access point). Almost all modern adapters support this, but older laptops (pre-2015) may have issues.
  • 📶 Adapter driver must be up-to-date. Outdated drivers are the cause of 80% of errors when distributing Wi-Fi via CMD.
  • 🔌 Internet connection It can be anything: Ethernet, USB modem or even another Wi-Fi (if your adapter supports it) Wi-Fi Direct).
  • 🛡️ Antivirus/firewall It shouldn't block network connections. Temporarily disabling it will help diagnose the problem.

To check support Hosted Network, open CMD as administrator and enter:

netsh wlan show drivers

Find the line in the results Hosted network support (Hosted Network Supported). If it's there Yes — we can continue. If No - update the driver or use an external Wi-Fi adapter.

⚠️ Attention: On some laptops Lenovo And HP (especially with adapters Realtek) function Hosted Network Disabled at the driver level. In this case, the only solution is to replace the driver with a modified one or use third-party utilities.

Step 1: Create a virtual access point via CMD

Now let's get practical. Open the command line. as administrator (This is a must!). To do this:

  1. Click Win + X and select Terminal (Administrator) or Command Prompt (Administrator).
  2. Enter the command to create the network (replace MyWiFi And 12345678 to your name and password):
netsh wlan set hostednetwork mode=allow ssid=MyWiFi key=12345678 keyUsage=persistent

Let's look at the command parameters:

  • mode=allow — allows the creation of a virtual network.
  • ssid=MyWiFi — the name of your Wi-Fi network (may contain spaces, but not special characters).
  • key=12345678 — password (minimum 8 characters).
  • keyUsage=persistent - saves settings after reboot.

If the command was successful, you will see the following message: Hosted network mode is enabled in the wireless network service. This means that the network has been created, but is not yet active.

Run CMD as administrator|Correct network name (no special characters)|Password length ≥8 characters|No errors after entering the command-->

Step 2: Start Wi-Fi sharing and check connections

The network is created, but it's not broadcasting yet. To start distribution, enter:

netsh wlan start hostednetwork

If everything went well, a message will appear: The hosted network is launchedYour laptop should now be visible to other devices in the list of available networks.

To check if the devices are connected, use the command:

netsh wlan show hostednetwork

In the results, pay attention to the lines:

  • State — it should be Launched.
  • Number of clients — the number of connected devices.
  • Channel - If the devices do not connect, try changing the channel (more on this below).
⚠️ Attention: If after the command start hostednetwork an error appears Failed to start hosted network, the cause may be a conflict with the antivirus (especially Kaspersky or Avast). Try temporarily disabling network protection in your antivirus settings.

Step 3: Sharing Internet Access

Currently, your network only provides a local connection, without internet access. To fix this, you need to enable Internet access sharing via a network bridge. Follow these steps:

  1. Open Control Panel → Network and Internet → Network and Sharing Center.
  2. Click Changing adapter settings.
  3. Find the connection through which your laptop receives the Internet (for example, Ethernet or Wireless network).
  4. Right click on it → Properties → tab Access.
  5. Check the box Allow other network users to use this computer's Internet connection.
  6. From the drop-down list, select the connection you created (usually it is called Local Area Connection* X, where X is a number).

After applying the settings, restart Wi-Fi distribution with the command:

netsh wlan stop hostednetwork

netsh wlan start hostednetwork

Common mistakes and their solutions

Even with the correct commands, Wi-Fi sharing may not work. Here are the most common issues and how to fix them:

Error Cause Solution
Failed to start hosted network The driver does not support Hosted Network or blocked by antivirus Update your driver or disable your antivirus. For adapters Realtek Try the driver from the laptop manufacturer's website.
The devices connect, but there is no internet. Sharing is not configured or there is an IP address conflict. Check your sharing settings (step 3). In CMD, run ipconfig /release And ipconfig /renew
The network disappears after rebooting Settings not saved keyUsage Repeat the network creation command with the parameter keyUsage=persistent
Slow speed or connection interruptions The Wi-Fi channel is overloaded or the signal is weak. Change the channel with the command netsh wlan set hostednetwork channel=6 (try channels 1, 6 or 11)

If none of the methods helped, try reset Windows network settings command:

netsh int ip reset

netsh winsock reset

After this, restart your laptop and repeat the setup from scratch.

Windows Default Mobile Hotspot|Command Prompt (CMD)|Third-Party Programs (Connectify, MyPublicWiFi)|Another Method-->

Signal and security optimization

By default, the virtual access point operates at minimum settings. To improve stability and security:

  • 📡 Change Wi-Fi channelIf there is interference from other networks, you can check the occupied channels in the program. Wi-Fi Analyzer (Android) or via command:
netsh wlan show all
  • 🔒 Use a complex password (at least 12 characters with numbers and letters). Password 12345678 from the example - just for testing!
  • 🔄 Limit the number of connected devicesTo do this, after starting the network, run:
netsh wlan set hostednetwork maxclients=5

Where 5 — maximum number of devices.

If you are distributing Wi-Fi in a public place, consider the possibility disabling access to the local network (so that connected devices cannot see each other). To do this, uncheck the box in the sharing settings (step 3) Allow other network users to control sharing....

How do I find out which Wi-Fi adapter is installed in my laptop?

Open device Manager (Win + X → Device Manager), expand the tab Network adaptersLook for devices with names Wi-Fi, Wireless or 802.11The most common manufacturers are: Intel, Qualcomm Atheros, Realtek, Broadcom.

Alternative Wi-Fi Sharing Methods (If CMD Doesn't Work)

If the command line stubbornly refuses to cooperate, there are several backup options:

  1. Windows Default Mobile Hotspot:

    Go to Settings → Network & Internet → Mobile HotspotHere you can enable sharing in two clicks, but the functionality is limited (for example, you can't select a Wi-Fi channel).

  2. PowerShell:

    Similar to CMD, but with different commands. Example of creating a network:

    New-NetVirtualizationProviderRoute -InterfaceIndex (Get-NetAdapter | Where-Object {$_.Name -like "Wi-Fi"}).ifIndex -ProviderAddress 192.168.137.1
  3. Third-party programs:

    Utilities like Connectify Hotspot, MyPublicWiFi or Virtual Router Plus They offer a graphical interface and additional features (such as traffic control or ad blocking). The downside is that many programs are paid or contain ads.

Comparison of methods:

Method Pros Cons
CMD (netsh) Maximum control, no unnecessary programs, works on all versions of Windows Requires knowledge of commands, possible driver errors
Mobile Hotspot Easy setup, Windows integration Limited settings, often doesn't work on older adapters
Third-party programs Additional functions (traffic filtering, autostart) Paid versions may have compatibility issues

FAQ: Frequently asked questions about sharing Wi-Fi from a laptop

Is it possible to distribute Wi-Fi if the laptop itself is connected to Wi-Fi (without Ethernet)?

Yes, but only if your Wi-Fi adapter supports the mode Wi-Fi Direct or AP+STA (simultaneous operation in access point and client modes). Check the adapter specifications on the manufacturer's website. In practice, this is unstable—it's better to use an Ethernet or USB modem.

Why is the internet speed lower when sharing from a laptop than when sharing directly?

The laptop acts as a router, and its processor handles all traffic. If you have a weak CPU (for example, Intel Celeron or AMD E-Series), this can slow down the connection. The connection type also plays a role: when sharing via Wi-Fi (laptop as a client + access point), the speed drops by 2-3 times.

How to automate distribution startup when turning on a laptop?

Create .bat-file with the following commands and add it to startup:

@echo off

netsh wlan start hostednetwork

exit

But keep in mind: Windows may reset sharing settings after a reboot. To be on the safe side, use Task Scheduler (taskschd.msc) running as administrator.

Is it possible to distribute Wi-Fi from a laptop? macOS or Linux?

Yes, but the teams will be different. macOS use Internet Sharing in the system settings. On Linux (Ubuntu/Debian) the utility will do hostapd or command:

sudo nmcli dev wifi hotspot ifname wlan0 ssid MyWiFi password "12345678"
How do I find out who is connected to my network?

Windows doesn't have a built-in tool for monitoring devices connected to a virtual network. However, you can use third-party utilities:

  • Wireless Network Watcher (from NirSoft) - shows all connected devices with MAC addresses.
  • GlassWire — monitors traffic for each device.

You can also view the ARP table in CMD:

arp -a