Sharing Wi-Fi from Your Computer Using the Command Line: A Complete Guide

Situations where you need to provide internet access to a smartphone or tablet without having your usual wireless router at hand arise quite often. This could be due to a business trip, a temporary equipment shortage, or a simple breakdown of the main router. In such cases Windows operating system takes over the functions of an access point, allowing you to use the built-in adapter of a laptop or PC to create a local network.

Usage command line (CMD) for this purpose gives the user maximum control over the process and allows one to bypass some limitations of the graphical interface. Unlike standard menu settings, the console method works more reliably across various system versions, from Windows 7 to the latest builds. Windows 10 and 11This method is also indispensable when drivers or system services are not working correctly, blocking standard functions.

To successfully complete the task, your device needs a working one. Wi-Fi module, supporting monitor or host network mode. Most modern laptops and USB adapters support this feature by default, but it's important to ensure the drivers are installed correctly. In this article, we'll cover the entire process in detail, from checking for support to starting traffic distribution.

Checking if the adapter supports virtual networking

Before entering complex commands, you need to make sure that your network adapter Technically, it's capable of operating in access point mode. Not all wireless cards support virtual networks, although such models are becoming increasingly rare. A special diagnostic command is used to check this, which lists all the capabilities of your equipment.

Open a command prompt as administrator. To do this, right-click the Start button and select the appropriate option from the menu. In the window that opens, enter the command netsh wlan show drivers and press Enter. The system will analyze the installed drivers and provide a detailed report on the device's status.

In the resulting list, find the line "Hosted network supported." If it says "Yes," you can proceed with setup. If it says "No," you won't be able to start sharing software-based methods—you'll need to replace the adapter or update the drivers to a newer version from the manufacturer.

It's worth noting that even with support, older adapters may be unstable or have low data transfer rates. In such cases, use 2.4 GHz band will be preferable as it has better compatibility with older equipment and penetration capability.

Configuring the parameters of the created network

The next step is to configure the parameters of the future access point. You'll need to set the network name (SSID) and password for the connection. This information will be used by your devices to authenticate to the newly created network. The command line allows you to flexibly configure these parameters without having to delve into deep system menus.

To create a network, use a command with the ssid and key parameters. The syntax is as follows:

netsh wlan set hostednetwork mode=allow ssid=MyVirtualWiFi key=SuperPassword123

In this example MyVirtualWiFi - this is the name that your gadgets will see, and SuperPassword123 — password. You can replace them with any others, following certain rules: the network name can contain up to 32 characters, and the password must be at least 8 characters. Using complex passwords with letters and numbers will increase connection security.

☑️ Pre-launch check

Completed: 0 / 4

After entering the command, the system will confirm the successful change of parameters. It is important to understand that the command mode=allow Not only sets the parameters, but also enables the virtual adapter to run. If you want to change the name or password in the future, simply re-enter the same command with the new values.

⚠️ Important: Be careful when entering your password. Characters entered in the command line are not displayed visually (no asterisks), so be careful when typing to avoid errors.

Starting a virtual router and stopping distribution

Once the network is configured, it needs to be activated. Until then, the virtual adapter is in sleep mode and does not broadcast a signal. The startup process takes just a few seconds and is performed with a single short command that initiates the hosted network service.

Type the following line and press Enter:

netsh wlan start hostednetwork

If everything went well, you'll see the message "Hosted network started." At this point, your computer will begin emitting a Wi-Fi signal, and you can find the created network in the list of available connections on your phone or tablet. To stop sharing, use a similar command with a different keyword:

netsh wlan stop hostednetwork

This feature is especially useful when you need to temporarily restrict internet access for connected devices without deleting network settings. You can stop streaming at any time and resume it later using the same commands. Console control allows you to quickly respond to changes in network activity.

📊 How often do you need to share Wi-Fi from your PC?
Daily
A couple of times a week
Only in emergency cases
Never used it

It's worth remembering that after restarting the computer, the running network is automatically disabled. This is standard system behavior, designed to conserve resources and ensure security. Therefore, the startup procedure (start hostednetwork) will have to be repeated every time you turn on your PC, unless you create a special script for automation.

Internet access organization (NAT)

The most common question users have is why devices connect to the created network, but the internet doesn't work. This is because we only created a local network but didn't configure traffic forwarding from the external network (Ethernet or 3G/4G modem) to the internal one. This is achieved using a technology called NAT (Network Address Translation), which must be activated through the network connection properties.

Click Win + R, enter ncpa.cpl and press Enter. The Network Connections window will open. Locate the adapter your computer uses to connect to the internet (usually Ethernet or Wi-Fi if you're connected to a different router). Right-click it, select "Properties," then the "Access" tab.

In the window that opens, check the box next to "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 (often called "Local Area Connection *" with a number). After applying the settings, the system will redirect the traffic.

Parameter Meaning / Action Note
Creation Team netsh wlan set hostednetwork... Sets the username and password
Launch command netsh wlan start hostednetwork Activates the access point
Access (NAT) Access tab in properties Required for internet operation
Diagnostics netsh wlan show hostednetwork Shows status and clients

Sometimes after enabling sharing, the system may automatically change the IP address of the virtual adapter to 192.168.137.1This is normal behavior and doesn't require manual changes. If the address hasn't changed or a conflict occurs, try disabling and then re-enabling the sharing checkbox.

Diagnostics of connected devices and status

To manage your newly created access point, it's helpful to know who's connected to your network and what the service's current status is. The command line provides tools for monitoring activity. This is especially useful if you want to ensure that no unauthorized devices are connecting to your Wi-Fi.

Use the command netsh wlan show hostednetworkThe output displays detailed information: SSID, authentication type, security key, and, most importantly, the number of connected clients. If you click "Clients," you can see the MAC addresses of the devices currently using your traffic.

It's also worth paying attention to the network status. If the status says "Stopped," then distribution isn't working, even if the start command was entered earlier. This could be due to a driver error or a hardware configuration change. Try running the command again. start hostednetwork usually solves the problem.

What to do if the status is "Failed to start"?

This is often due to the "WLAN AutoConfig" service being disabled. Check its status in services.msc and set the startup type to "Automatic."

The maximum number of connections is limited by the capabilities of your adapter and operating system. Windows typically allows up to 100 devices to be connected, but the actual internet speed will be divided among them, which can lead to a significant drop in performance with a large number of users.

Common errors and how to fix them

During setup, users often encounter various system errors that prevent the virtual router from launching. One of the most common is "Failed to start hosted network." This message can appear for a variety of reasons, from disabled services to driver issues.

The first thing you need to do is check the WLAN AutoConfig service. Click Win + R, enter services.mscFind "WLAN AutoConfig" in the list. Make sure it's running and the startup type is set to "Automatic." Without this service, Wi-Fi in Windows won't work.

The second common issue is drivers. If you've updated Windows but the driver is still outdated, the hosted network feature may stop working. Visit the laptop or motherboard manufacturer's website and download the latest driver for the wireless module. Removing the old driver and installing a new one from scratch often helps.

⚠️ Note: Antivirus programs and firewalls may block the creation of a virtual network. If all else fails, try temporarily disabling your third-party antivirus and testing the network.

It's also worth considering that some corporate security policies or specific BIOS settings may prohibit changing the network card's operating mode. In such cases, Wi-Fi sharing may be impossible without changing the system's security settings or firmware.

Automating network startup at system startup

Since the created network doesn't start automatically after a reboot, manually entering commands each time can be tedious. There's a way to automate this process by creating a simple batch file that will launch with Windows. This will save time and make using the feature more convenient.

Create a text file on your desktop and paste the network startup commands (start hostednetwork) into it. Save the file with the extension .bat (For example, wifi_start.bat). To run it automatically with administrator rights, you can use Windows Task Scheduler by creating a task with the "At logon" trigger and the highest level of rights.

To stop the network, you can create a second file with the command stop hostednetworkThis allows you to manage your access point with just two clicks, without opening the console each time or remembering command syntax. This approach turns your laptop into a fully-fledged desktop router.

However, it's important to remember that automatic startup requires the Wi-Fi drivers to load before the script runs. Sometimes it's necessary to add a small delay to the script or configure the task to depend on the network adapter service to avoid system startup errors.

Is it possible to share Wi-Fi if the computer is connected to the Internet via Wi-Fi?

Yes, this is possible, but it requires two wireless adapters (for example, one built into a laptop and an external USB adapter). One adapter will receive the signal from the main router, and the other will distribute it further. You can't create a virtual network over an existing Wi-Fi connection using just one adapter using standard Windows tools.

Why does my phone connect but say "No Internet access"?

The problem is most likely with the network access (NAT) settings. Check that the correct network is selected in the "Access" tab of the primary adapter's properties. Also, make sure the primary computer's internet connection is stable and not blocked by a firewall.

Does Wi-Fi sharing affect the speed of the computer itself?

Yes, it does. The computer acts as a gateway, handling all traffic from connected devices. This places additional strain on the processor and network adapter, which can lead to a decrease in speed, especially when downloading large files or streaming video on connected devices.

Is it safe to use this method in public places?

Using WPA2-PSK encryption (which is set by a command) provides a basic level of security. However, the risk of data interception is still higher in public places. It is not recommended to transmit confidential information or enter credit card passwords while on an open public network, even if you created the hotspot yourself.