How to share Wi-Fi from a Windows 10 laptop using the command line

In today's world, access to the global network is becoming a critical resource, often resulting in situations where only a desktop computer or laptop has wired internet, while mobile devices require a connection. Standard operating system graphical interfaces don't always provide convenient tools for instantly creating an access point, especially on corporate networks or when using specific drivers. This is where built-in functionality comes in handy. Windows 10, which allows you to turn your laptop into a full-fledged router with just a few commands.

Using the command line gives the user direct control over network interfaces, bypassing potential graphical shell bugs or third-party software limitations. This method is especially relevant for system administrators and advanced users who need to quickly set up a temporary network without installing unnecessary software. Furthermore, this method is often the only viable option when wireless adapter drivers conflict with the standard features of a mobile hotspot.

In this article, we'll take a detailed look at setting up internet sharing, focusing on command syntax, error diagnostics, and the nuances of network protocols. You'll learn how to configure it correctly. netsh wlan, check hosting support, and ensure the security of the connection being established. A thorough understanding of the processes occurring at the network interface level will allow you to avoid common connection issues.

Checking hosting support and preparing the adapter

The first and most important step before beginning any modifications is to check the technical condition of your wireless module. Not all Wi-Fi adapters, especially older models or specific corporate devices, support access point virtualization mode. First, you need to launch the command prompt with administrator rights, as system changes require elevated privileges.

Enter the command netsh wlan show drivers and carefully review the list of parameters displayed. You're looking for the line "Hosted network supported." If it says "Yes," your adapter is ready to use. If it says "No," you'll need to update the drivers from the manufacturer's website or replace the hardware.

⚠️ Note: If the driver is updated but support is still not displayed, try uninstalling the device in Device Manager and rescanning the hardware to allow the system to reinitialize the module.

Antivirus software or firewalls that block the creation of virtual interfaces are often the cause of problems. Before running commands, it's recommended to temporarily disable third-party security tools to prevent them from affecting the network stack. WindowsAlso, make sure that the Wi-Fi module itself is turned on physically or via a software button on the laptop case.

📊 What wireless adapter do you have?
Built into the motherboard
USB whistle
External PCI card
I don't know / it's built into the laptop

Creating and configuring a wireless network

Once the drivers have been successfully verified, you can begin creating the virtual access point. The setup process requires entering the exact SSID (network name) and security key. Syntax errors may prevent the network from starting or making it undiscoverable by other devices.

To create a network, use a command with the ssid and key parameters. The network name can be anything, but it's recommended to use Latin characters to avoid encoding issues on older devices. The password must be at least 8 characters long, otherwise the WPA2-Personal security protocol will not activate.

netsh wlan set hostednetwork mode=allow ssid=MyNetworkName key=MyPassword123

In this design the parameter mode=allow allows the hosted network to be launched, and the keyword keyUsage=persistent (If added) will save the settings after a reboot, although in Windows 10, settings are often reset and require re-entering. After executing the command, the system will confirm the successful change of settings.

☑️ Pre-launch check

Completed: 0 / 4

It's important to understand that creating a network only prepares the configuration, not activates it. You can create multiple profiles with different names and switch between them by changing command parameters. This is convenient for testing equipment or setting up temporary access zones with different permissions.

Launching an access point and managing its state

Once the network is configured, it needs to be activated. This is done using the command netsh wlan start hostednetworkOnce completed, a new network interface should appear in the notification area (tray), and the SSID you specified will appear in the list of available connections on smartphones and tablets.

Network state management is carried out by three main commands: start, stop and status. Command netsh wlan status hostednetwork Displays detailed information about the current status, including the number of connected clients, security type, and communication channel. This is an invaluable tool for initial diagnostics.

netsh wlan stop hostednetwork

Use the stop command if you need to change security settings or the network name, as editing a running network is impossible. Restarting the service also helps "shake up" a frozen network stack if devices stop receiving IP addresses.

What to do if the network does not start?

The "Failed to locate network" error often occurs because the WLAN AutoConfig service is stopped or blocked. Check its status in services.msc and ensure it's running automatically. Also, try temporarily disabling your antivirus.

In some cases, especially after Windows 10 updates, there may be a delay in creating the virtual adapter. If the command is successful but the network is not visible, wait 10-15 seconds and refresh the list of networks on the client device. Stability The connection quality directly depends on the signal quality of the main adapter.

Setting up Internet access sharing (NAT)

The most critical aspect of this entire guide is providing access to the global network. By default, the access point created doesn't have internet access; it only connects devices to a local network. To share the internet, you need to configure traffic forwarding through a network interface that's already connected to the network (Ethernet or primary Wi-Fi).

To do this, go to the Network Control Panel. Click Control Panel → Network and Internet → Network and Sharing Center → Change adapter settingsHere you'll see a list of all your network connections. Find the one that connects your laptop to the internet, right-click it, and select "Properties."

In the window that opens, go to the "Sharing" tab. Check "Allow other network users to connect through this computer's Internet connection." In the drop-down list below, select the virtual adapter you created earlier (usually named "Wireless Network" with a number, such as "Wireless Network 2").

Parameter Meaning / Action Note
Source interface Ethernet / Primary Wi-Fi Where there is internet
Destination interface Local Area Connection* (Virtual) Created by the netsh command
IP protocol Automatic (DHCP) Clients receive IP from the host
DNS server Automatically Or enter 8.8.8.8 manually

After applying the settings, the system may warn you that the host computer's IP address has changed to a static one (usually 192.168.137.1). This is normal behavior and ensures the operation NAT (Network Address Translation). Without this step, devices will connect to Wi-Fi, but pages will not load in the browser.

Diagnosis of typical errors and their solutions

Despite the simplicity of the method, users often encounter various errors upon startup. One of the most common is "Failed to locate network." This often indicates that the WLAN AutoConfig service is not running or the adapter driver does not support monitor mode. Check via netsh wlan show drivers is required here.

Another common issue is that devices connect, but the internet doesn't work. This is almost always a problem with the network access (NAT) settings. Make sure you're sharing the same connection you use to access the internet and select the correct virtual adapter as the destination. Sometimes resetting TCP/IP settings with the command netsh int ip reset.

⚠️ Note: Antivirus software with the "Network Protection" feature may block the creation of virtual bridges. If all else fails, add an exception for Windows system processes in your firewall settings.

If your connection speed is extremely slow, check to see if your laptop is in power-saving mode. In Device Manager, under the Wi-Fi adapter properties, under the "Power Management" tab, uncheck "Allow the computer to turn off this device to save power." This will prevent intermittent connection drops.

Alternative methods and automation

Constantly entering commands manually can be tedious, especially if you need to frequently change passwords or network names. Windows allows you to create batch files to automate this process. Create a text file, enter the start and stop commands, save it with the .bat extension, and run it as administrator with one click.

Additionally, Windows 10 has a built-in "Mobile Hotspot" feature accessible through the Settings graphical interface (Start → Settings → Network & Internet → Mobile hotspot). It is easier to use, but less flexible in settings and may not work on some older adapters, where the command line is still the only solution.

Advanced users can automate their network using PowerShell, which allows not only network management but also real-time traffic monitoring. However, for basic internet sharing, the classic CMD command line remains the most reliable, compatible, and time-tested tool.

Is it possible to distribute Wi-Fi if the laptop is connected to Wi-Fi?

Yes, this is possible if your Wi-Fi adapter supports "simultaneous AP and Station" mode. Most modern cards based on Intel and Qualcomm chips support this, but older models may require a second USB Wi-Fi adapter.

How can I find out the password for the created network?

You set the password when creating the network using the set hostednetwork command. If you forget it, simply re-enter the creation command with the new password; the settings will be updated instantly.

Why does the phone see the network but not connect?

The issue is most likely related to the encryption type or password length. Make sure the password contains at least 8 characters. Also, try changing the broadcast channel in the adapter driver settings to 1, 6, or 11.

Are the settings reset after a reboot?

The network itself (name and password) is saved in the Windows profile, but the "Running" status is reset. You will have to re-enter the start hostednetwork command after each system reboot unless you use startup scripts.