Ad-Hoc Wireless Network Setup

Here's how to build a computer-to-computer P2P network

What to Know

  • In Windows 10 or 8, enter netsh wlan set hostednetwork mode=allow ssid=networkname key=password in Command Prompt.
  • Replace networkname with your network name and password with the password for the wireless network and press Enter.
  • Enter netsh wlan start hostednetwork to start the hosted network.


This article explains what a Wi-Fi network in ad-hoc mode does and how to set up an ad-hoc network on Windows 10, 8, and 7.

Ad hoc network topology peer device connection.
bakhtiar_zein / Getty Images

What is Ad-Hoc Mode in Wi-Fi?

A Wi-Fi network in ad-hoc mode (also called computer-to-computer or peer mode) lets two or more devices communicate directly instead of through a central wireless router or access point (which is what infrastructure mode does).

Setting up an ad-hoc network is useful if there isn't a wireless structure built, like if there aren't any access points or routers within range. The devices don't need a central server for file shares or printers. Instead, devices can access each other's resources directly through a simple point-to-point wireless connection.

How to Set Up an Ad-Hoc Network on Windows

The devices that take part in the ad-hoc network require a wireless network adapter. In addition, the devices have to support a hosted network.

To see if your wireless adapter has hosted network support, look for it in Command Prompt after running the command. You might need to open Command Prompt as an administrator for that command to work.

Windows 10 and Windows 8

These versions of Windows make it a little tougher to make an ad-hoc network when you compare the procedure to earlier Windows operating systems. If you want to set up the ad-hoc network manually without using any other software but what Windows has available, open Command Prompt and enter this command, replacing networkname with your network name and password with the password for the wireless network:

netsh wlan set hostednetwork mode=allow ssid=networkname key=password

Start the hosted network:

netsh wlan start hostednetwork

Windows 7

  1. Access the Network and Sharing Center section of Control Panel by opening Control Panel and then selecting that option. Or, in Category view, first, choose Network and Internet.

  2. Choose the link called Setup a new connection or network.

  3. Select the option called Set Up a Wireless Ad Hoc (Computer-to-Computer) Network.

  4. Enter the network name, security type, and security key (password) that the network should have. Select the Save this network check box so that it will be available later.

  5. Click Next to close any unnecessary windows.

How to Set Up an Ad-Hoc Network on macOS

Choose the Create Network menu option from Wi-Fi status symbol (usually accessible from the main menu bar), select the Create a Computer-to-Computer Network option, and follow the instructions provided.

When using the ad-hoc mode, protect yourself from several known security problems and performance limitations of ad-hoc Wi-Fi networks.

The most common sources of trouble in ad-hoc mode networking are incorrect configuration and insufficient signal strength. Ensure your devices are located close to each other and that the configuration settings are identical on each device.

Was this page helpful?