Creating a local network between two laptops via Wi-Fi is a challenge faced by students collaborating on projects, gamers playing multiplayer games offline, or office workers transferring large files. Unlike a wired connection, a wireless network eliminates the need for cables and adapters, but it does require proper security settings and protocol compatibility.
In this article, we will look at three main methods of organizing communication: Ad-Hoc network (an outdated but working method) Wi-Fi Direct (modern standard for direct connection) and access point mode (via the built-in Hotspot). Each of them has its own limitations: for example, Ad-Hoc not supported in Windows 11 by default, and Wi-Fi Direct may not work on older laptops with adapters up to 802.11nWe'll also cover setting up file sharing and diagnosing common errors, from missing IP addresses to channel conflicts.
If you need to do more than just connect devices, but also share internet from one laptop to another, there's a separate section at the end of the article with step-by-step instructions for this setup. And for those working with macOS or Linux, we have provided terminal commands and settings features in these operating systems.
1. Method 1: Ad-Hoc network (for Windows 7/10 and older adapters)
Ad-Hoc (from the Latin "for this") is a temporary computer-to-computer network that does not require a router. This method is relevant for devices without support Wi-Fi Direct or when working with older versions of Windows. However, in Windows 11 Creating an Ad-Hoc network via the graphical interface has been removed - you will need to use the command line.
The main limitations of the method:
- 🔌 Maximum speed - up to
54 Mbps(standard802.11g), which is 10 times slower than modernWi-Fi 6. - 🛡️ Vulnerability to attacks - encryption
WEP(if selected) hacks in minutes, use onlyWPA2-PSK. - 🖥️ Does not work between Windows and macOS without additional drivers.
Instructions for Windows 10:
- Open
Control Panel → Network and Sharing Center → Set up a new connection. - Select
Setting up a wireless computer-to-computer network. - Specify the network name (SSID), security type
WPA2-Personaland the password is not shorter than 8 characters. - On the second laptop, connect to the created network as a regular access point.
Make sure your Wi-Fi adapters support Ad-Hoc mode (check in Device Manager)
Disable any antivirus firewalls (they may be blocking the connection)
Use channel 1, 6 or 11 (they do not overlap with other networks)
-->
⚠️ Attention: If you cannot access the local network after connecting, check your settingsIPv4Manually. On the first laptop, set the IP192.168.0.1, on the second -192.168.0.2with a mask255.255.255.0.
2. Method 2: Wi-Fi Direct (modern standard for Windows 10/11 and Android)
Wi-Fi Direct — a protocol that allows devices to connect directly without an intermediary (router), like Bluetooth, but at Wi-Fi speeds. Supported by all laptops with adapters 802.11n and newer (released after 2010). The main advantage is automatic IP configuration and high speed (up to 250 Mbps in standard 802.11ac).
How to enable Wi-Fi Direct in Windows:
- 🔍 In the search bar, enter
cmd, run command prompt as administrator. - 📋 Enter the command:
and check the linenetsh wlan show driversHosted Network Support— it should be"Yes". - 🔄 If support is available, create a network using the command:
netsh wlan set hostednetwork mode=allow ssid=MyDirect key=12345678 keyUsage=persistent - ▶️ Start the network:
netsh wlan start hostednetwork
On the second laptop, connect to the network MyDirect (in our example) via the standard Wi-Fi manager. To share files, enable public access to folders in network properties (Private network).
| Parameter | Ad-Hoc | Wi-Fi Direct | Access point mode |
|---|---|---|---|
| Max. speed | 54 Mbps | 250+ Mbps | 150 Mbps |
| Windows 11 support | ❌ (only via CMD) | ✅ | ✅ |
| Encryption | WEP/WPA2 | WPA2/WPA3 | WPA2-PSK |
| IP autoconfiguration | ❌ | ✅ | ✅ |
3. Method 3: Hotspot mode via Windows/macOS
The most universal method is to turn one laptop into an access point and connect the second one to it as a regular router. This method is suitable for sharing the internet (if the first laptop has one) or creating an isolated local network. Windows 10/11 the function is called Mobile Hotspot, V macOS — "Public Internet".
Step-by-step instructions for Windows:
- 🖱️ Go to
Settings → Network & Internet → Mobile Hotspot. - 🔄 In the field
Internet Connection SharingSelect the source (Wi-Fi or Ethernet). - 📶 Click
"Change"and set the network name (SSID) and password (minimum 8 characters). - 🔛 Turn on the slider
Internet distribution.
For macOS Monterey/Ventura:
- Open
System Preferences → Sharing. - Select a source from the drop-down menu
"Public Internet: "(For example,Ethernet). - Activate the checkbox
"Wi-Fi"and pressWi-Fi Settingsto set up SSID and password. - Turn on sharing with the button
"Start".
⚠️ Attention: If an error appears when turning on a hotspot in Windows"Unable to set up mobile hotspot", check if your Wi-Fi adapter supports the modeAP (Access Point). A list of compatible adapters can be found on the manufacturer's website (for example, Intel Wireless-AC 9560 supports, and Realtek RTL8188EE - No).
Ad-Hoc (via command line)
Wi-Fi Direct
Hotspot mode
Another option-->
4. Setting up shared access to files and folders
Creating a network is only half the battle. To share files, you need to set up public access to folders. In Windows, this is done through the folder properties, in macOS - through "Public Access" in the system settings. Important: both laptops must be in the same working group (by default WORKGROUP in Windows, local (in macOS).
Instructions for Windows:
- 📁 Right-click on the folder →
Properties → Access → Share. - 👥 Select a user
"All"and set the resolutionReading and writing. - 🔐 Tab
"Safety"→"Change"→ add user"All"with full rights. - 🌐 On the second laptop, open
IP address of the first laptopin Explorer (for example,\\192.168.137.1).
For Linux (Ubuntu/Debian):
sudo apt install samba
sudo nano /etc/samba/smb.conf
Add to the end of the file:
[shared]path = /path/to/folder
browsable = yes
read only = no
guest ok = yes
Then restart the service:
sudo systemctl restart smbd
How to speed up file transfers over Wi-Fi?
Use archiving in .zip or .rar - one large file is transferred faster than thousands of small ones.
Disable power saving for your Wi-Fi adapter in Device Manager (Power Management tab).
Switch to the channel 5 GHz (if the adapters support it) - there is less interference from other networks.
5. Troubleshooting: No connection or file access
If the laptops cannot see each other or exchange data, check the following settings:
- 🔌 Ping between devices: open cmd and type
(where xx is the IP address of the second laptop). If packets are lost, the problem is with the network connection.ping 192.168.x.x - 🛡️ Firewall: temporarily disable it on both devices or add an exception for file-sharing ports (
137-139, 445). - 🔄 IP conflict: if both laptops have received the same IP (for example,
169.254.x.x), set static addresses manually. - 📡 Drivers: Update your Wi-Fi adapter driver - older versions may not support it. Wi-Fi Direct.
Critical Error: If you get the message "Windows can't connect to this network" when connecting to an Ad-Hoc network, check if the first laptop is in compatibility mode with 802.11b/gIn some cases, rolling back the adapter driver to an older version helps (for example, for Broadcom 4313).
⚠️ Attention: On laptops with Windows 11 and adapters Killer Wireless (for example, in game models MSI or Alienware) it may be necessary to disable the technology Killer Prioritization Engine in the driver control panel. It blocks P2P connections to "optimize traffic."
6. How to share internet from one laptop to another
If the first laptop has internet access (via Ethernet or 4G), you can share it with the second device via Wi-Fi. To do this:
In Windows:
- Turn on
Mobile hotspot(see section 3). - In the field
"Sharing"select the connection through which you receive the Internet (for example,Ethernet). - Activate sharing and the second laptop will automatically gain access to the network.
On macOS:
- IN
System Preferences → Sharingselect the internet source (for example,USB-Ethernet). - Activate the checkbox
"Wi-Fi"and configure network settings. - Turn on sharing – the Internet will be distributed to connected devices.
7. Alternative methods: Bluetooth, Ethernet, and P2P software
If a Wi-Fi connection is not possible (for example, the adapter is broken), consider alternatives:
- 🔵 Bluetooth: speed up to
3 Mbps(suitable for transferring documents, but not video). Enabled viaSettings → Devices → Bluetooth. - 🔌 Ethernet cable: connect laptops crossover cable (or normal if the ports support it)
Auto-MDI/MDIX). Configure the IP manually (for example,192.168.1.1And192.168.1.2). - 💻 P2P programs:
- LocalSend (cross-platform, with encryption).
- Feem (simple interface, works without a router).
- Dukto R6 (for transferring files and text).
To connect via Ethernet in Linux, use the command:
sudo ip link set eth0 up
sudo ip addr add 192.168.1.1/24 dev eth0
(replace eth0 to the name of your network interface).
FAQ: Frequently asked questions about setting up a network between laptops
Is it possible to connect a laptop to a Mac and Windows via Wi-Fi?
Yes, but with some reservations:
- 🍎 Mac does not support connection to Ad-Hoc Windows default networks. Use Wi-Fi Direct or access point mode.
- 🪟 On Windows, when creating a network, select the security type
WPA2-PSK (AES)— this is the only compatible option for macOS. - 🔄 To share files, turn on
SMB(on macOS:System Preferences → Sharing → Files & Folders).
Why is the file transfer speed via Wi-Fi low (1-2 MB/s)?
Reasons and solutions:
- 📶 Weak signal: Check the distance between laptops (maximum 10 meters) and the absence of obstacles.
- 🔄 Congested channel: use the utility Wi-Fi Analyzer (Android) or NetSpot (macOS/Windows) to select a free channel.
- 🖥️ Outdated adapter: If the laptop is older than 2015, it can only work in standard
802.11n(max 150 Mbps). - 🛡️ Encryption:
WPA3may reduce speed on older devices - switch toWPA2.
How can I make the network be created automatically when I start my laptop?
For Wi-Fi Direct (Windows):
- Create
.batfile with commands:netsh wlan start hostednetworktimeout /t 5 - Put it in startup:
Shell:Startupin the address bar of the explorer.
For macOS use launchd:
sudo nano /Library/LaunchDaemons/com.user.wifidirect.plist
Paste the config (an example can be found at GitHub For create_wifi_network).
Is it safe to transfer files via Ad-Hoc or Wi-Fi Direct?
The security level depends on the settings:
- ✅ Wi-Fi Direct with WPA3 — the most secure option (encryption
AES-256). - ⚠️ Ad-Hoc with WEP - vulnerable to hacking in 1-2 minutes (use only
WPA2-PSK). - 🔍 Risks:
- Interception of traffic with a weak password (use a combination of 12+ characters).
- Man-in-the-middle attacks in public places (don't set up a network in cafes/airports).
- 🛡️ Additional protection:
- Turn off the network after use.
- Use a VPN (eg. WireGuard) to encrypt traffic.
Is it possible to play on a local network using this connection?
Yes, but with restrictions:
- 🎮 Supported games: Minecraft, Terraria, Counter-Strike 1.6 (via Hamachi), Stardew Valley.
- ❌ Not suitable for: Call of Duty: Warzone, Fortnite (require internet connection for authorization).
- 🔧 Setting up:
- In the game, select
Local Area Networkor"LAN". - If the game requires an IP, please specify the local host address (e.g.
192.168.137.1).
- In the game, select
- ⚠️ Problems:
- Delays (
ping) can reach 50-100 ms (versus 1-10 ms via cable). - IN Wi-Fi Direct Connection breaks are possible under high load.
- Delays (