How to share WiFi from a computer using the command line

Many users are familiar with the situation of urgently needing to connect their smartphone or tablet to wireless internet, but don't have a router at hand. Fortunately, the operating system Windows has built-in functionality that allows you to turn your laptop or desktop PC into a hotspot. Using the command line interface provides maximum control over the process and eliminates the need to install third-party software, which is often cluttered with ads.

This method is especially relevant when the system's graphical interface is not working correctly or fine-tuning of network settings is required. You will be able to create virtual adapter, which will broadcast the signal to surrounding devices. The main requirement is a working wired or wireless connection to the global network on the computer itself.

Before entering the code, you need to ensure that your equipment supports the required operating mode. Most modern network cards released in the last decade handle this task without any problems. However, older models may not have sufficient power to emulate a base station.

📊 What is your wired internet source?
Ethernet (provider cable)
USB modem (3G/4G whistle)
Smartphone via USB
Another Wi-Fi (repeater)

Checking hosted network support

The first step is to diagnose the capabilities of your network adapter. Not all drivers allow the device to operate in host mode. To check, launch the console with administrator rights and enter the command netsh wlan show driversIn the list of options that opens, find the line "Hosted network support."

If this parameter reads "Yes," you can safely proceed to the next step. If the answer is "No," the problem lies with the drivers. You'll need to update your network card software or, in rare cases, replace the adapter itself with a more modern one.

⚠️ Note: If support still doesn't appear after updating your drivers, try disabling power saving in Device Manager, as some card models block this feature to save battery power.

Sometimes the system may show multiple adapters. In this case, it's important to understand which one will be used for distribution. Typically, this is the built-in module. Wi-Fi, but if you have a USB dongle, the priority may shift.

What to do if the driver is not updated?

If the automatic search doesn't help, visit the laptop or motherboard manufacturer's website. Download the driver specifically for your network card model and the Windows version you're using. Installing generic drivers can cause instability.

Launching a virtual access point

The network is created through a utility netshYou will need to set a network name (SSID) and a password. The password should be complex enough, at least 8 characters, to ensure basic connection security. Enter the following construction:

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

Instead of MyNetworkName Enter the desired name that will be visible to other devices. Field key Replace with your unique access key. Once the command is successfully executed, the system will confirm profile creation.

Now you need to activate the created interface. To do this, use the launch command:

netsh wlan start hostednetwork

If everything went well, you'll see a message indicating that the hosted network has started. At this point, your computer will begin broadcasting a signal. However, the internet will not work on connected devices yet, as we've only created a communication channel but haven't configured forwarding.

☑️ Network startup check

Completed: 0 / 1

Setting up Internet sharing

The key step in the entire process is transferring the internet connection from the primary adapter to the virtual one. To do this, go to the Network Control Panel. Click Win + R, enter ncpa.cpl and press Enter. A window will open with a list of all network connections.

Find the adapter your computer uses to connect to the internet (e.g., "Ethernet" or "Wireless"). Right-click it, select "Properties," then the "Sharing" tab. Check the box next to "Allow other network users to connect through your internet connection."

Parameter Meaning / Action Where to find
Home network name Select the created adapter Access tab
Gateway IP address 192.168.137.1 Automatically
Connection status Connected Control Panel
Access type General Adapter properties

In the "Home Network Connection" drop-down list, select the adapter with the name you specified when creating the hosted network (usually it contains the words "Local Area Connection" and a number). After applying the settings, the system will warn you that the IP address has changed to 192.168.137.1. This is normal.

Now devices connected to your access point should be able to access the global network. If this doesn't happen, check if there's something blocking it. firewall connection. Sometimes you need to temporarily disable your antivirus for a check.

Network connection management

After setting up, you may need to stop distribution or change settings. To stop broadcasting a signal, use the command:

netsh wlan stop hostednetwork

This is useful if you want to temporarily disable access for all devices without deleting the network profile itself. To restart sharing, simply repeat the startup command. start hostednetwork, which we used earlier.

If you decide to change your password or network name, you don't need to delete the old profile. Simply re-enter the setup command (set hostednetwork) with the new key values. The system will automatically update the configuration.

To view the current status of a hosted network, including the number of connected clients and authentication type, enter:

netsh wlan show hostednetwork
⚠️ Note: When you change your password, all previously connected devices will lose connection and require a new security key. Make sure you have physical access to your devices to enter the new information.

Diagnostics and troubleshooting

The most common issue is the error "Failed to start the hosted network." This can occur for various reasons, from a disabled service to a driver conflict. First, check the "WLAN AutoConfig" service. It should be running and running automatically.

It's also worth paying attention to Windows updates. Some major service packs can reset network stack settings or change security policies. In this case, resetting network settings via the command line can help:

netsh winsock reset

After running this command, you will need to restart your computer. If the problem persists, try removing the virtual adapter completely with the command netsh wlan set hostednetwork mode=disallow, and then create it again.

Safety and limitations of the technology

When using a computer as a router, it's important to remember security. Encryption protocol WPA2-PersonalThe default Wi-Fi network provides sufficient security for home use. However, it should not be used to transmit critical banking data in public places.

There are also technical limitations. Internet speed will be limited by the performance of your computer's Wi-Fi module and signal quality. Furthermore, a laptop in hotspot mode consumes more power, which reduces battery life.

The number of connected devices is also limited by the operating system. Windows typically allows up to 100 clients, but actual performance will begin to degrade after 5-7 active users.

⚠️ Caution: Do not leave an open access point turned on unattended in crowded areas. Attackers may attempt to connect to your channel for illegal activities, which can be traced using your IP address.

Is it possible to share Wi-Fi if it is already connected to Wi-Fi?

Technically, this is possible, but it requires two physical Wi-Fi adapters (for example, a built-in one and a USB dongle). One will receive the signal, and the other will broadcast it. It's extremely rare for both client and host modes to work simultaneously on a single adapter.

Frequently Asked Questions

Will this method work on Windows 7, 8 and 11?

Yes, the command described netsh wlan It is supported in all modern versions of Windows, starting with Windows 7. The interface may differ slightly, but the command syntax remains the same.

Why does the phone see the network but not connect?

Most often, this is due to an error in the encryption type or an incorrectly entered password. Try changing the password to a simpler one (numbers and Latin characters only) or resetting the network settings on your phone.

How to increase the range of such an access point?

Signal strength can't be increased using software; it's limited by hardware. However, using a USB Wi-Fi adapter with an external antenna will significantly improve coverage compared to the laptop's built-in module.

Do I need to enter commands every time after rebooting?

Network setup (set hostednetwork) is stored in memory. However, the launch itself (start hostednetwork) must be performed again after each PC reboot, unless you create a special startup script.

Is it possible to share the Internet via Bluetooth instead of Wi-Fi?

Command line netsh wlan It's designed exclusively for Wi-Fi. Sharing internet via Bluetooth is possible, but it's configured through a graphical interface and has significantly lower data transfer rates.