How to Connect Two Laptops via Wi-Fi Without a Router: A Step-by-Step Guide

Why connect laptops directly via Wi-Fi and when is it relevant?

Directly connecting two laptops via Wi-Fi without a router is a solution for situations where you need to quickly transfer files, organize an online game, or share the internet from one device to another. This method is called Ad-Hoc network (in Windows) or Wi-Fi Direct access point (in modern operating systems). It works even in places without access to a router: outdoors, on a trip, or in an office with unstable internet.

Main usage scenarios:

  • 📁 Transfer large files (videos, archives, projects) without flash drives or clouds
  • 🎮 Local network for multiplayer games (Minecraft, CS 1.6, etc.)
  • 🌐 Sharing the Internet from a laptop connected to a mobile network (3G/4G/5G)
  • 🔧 Diagnosing network problems or setting up a second device

It is important to understand that a direct connection has limitations: the data transfer speed will be lower than through a router (maximum ~50-70 Mbps in real conditions), and the range rarely exceeds 10-15 meters. But this method It doesn't require any additional hardware and works on all laptops with Wi-Fi adapters (even those released 10+ years ago)..

📊 Why do you most often connect devices directly?
File transfer
Local Area Network Games
Internet Sharing
Setting up equipment
Other

Preparing laptops for connection: checking compatibility and requirements

Before setting up a direct connection, make sure both laptops meet the minimum requirements:

Parameter Windows 10/11 macOS (12+) Linux (Ubuntu/Debian)
Ad-Hoc/Wi-Fi Direct support Yes (all versions) Yes (via Terminal) Yes (package hostapd)
Minimum Wi-Fi version 802.11a/b/g 802.11n 802.11n
Wi-Fi adapter driver Any (including Realtek, Intel, Broadcom) No restrictions Support AP mode
Max. number of devices 8 (theoretically) 5 10+ (depending on OS)

To check adapter compatibility in Windows:

  1. Click Win + X → select device Manager.
  2. Expand the branch Network adapters → find your Wi-Fi module (for example, Intel Wi-Fi 6 AX200).
  3. Right click → Properties → tab Additionally.
  4. Check for the presence of parameters Ad Hoc 11n or Wireless Mode (must have a value 802.11a/b/g or higher).
⚠️ Note: Laptops with adapters Realtek RTL8188EE or RTL8723BE (often found in budget models) may not support access point mode. In this case, the only solution is to replace the driver or use an external USB adapter.

Method 1: Creating an Ad-Hoc Network in Windows (Universal Method)

This method works on all versions of Windows from 7 to 11 and allows you to create a temporary network that other devices can connect to. This guide is applicable to laptops with any Wi-Fi adapter, except for the problematic models mentioned above.

Steps to set up on main laptop (which will distribute the network):

Open a command prompt as administrator|Enter the command netsh wlan set hostednetwork|Set the network name (SSID) and password|Start the network with the command netsh wlan start hostednetwork|Enable Internet sharing (if necessary)-->

  1. Open the command prompt as administrator:
    • Click Win + S, enter cmd.
    • Right click on Command lineRun as administrator.
  • Create a virtual network command:
    netsh wlan set hostednetwork mode=allow ssid="MyLaptopNet" key="12345678" keyUsage=persistent

    Replace MyLaptopNet to the desired network name, and 12345678 — password (minimum 8 characters).

  • Start the network:
    netsh wlan start hostednetwork

    If an error occurs Failed to start hosted network, update your Wi-Fi adapter driver.

  • Enable Internet Sharing (if you need to distribute the Internet):
    • Open Control Panel → Network and Sharing Center → Change adapter settings.
    • Find the connection through which the laptop receives the Internet (for example, Ethernet or Wireless network*).
    • Right click → Properties → tab Access.
    • Check the box Allow other network users to share your Internet connection.
    • Select from the drop-down list Local Area Connection* X (where X is the virtual adapter number).
    • On second laptop:

      1. Open the list of Wi-Fi networks.
      2. Find the network with the name MyLaptopNet (or whatever you specified).
      3. Connect by entering the password.
    ⚠️ Note: In Windows 11, a notification may appear after connecting a second device. "No internet access" This is normal if you haven't set up sharing. Internet access is not required to transfer files.

    Method 2: Wi-Fi Direct in Windows 10/11 (without Command Prompt)

    Modern versions of Windows support the technology Wi-Fi Direct, which allows you to connect devices without creating a separate network. This method is simpler than Ad-Hoc, but it doesn't work on all adapters (especially older ones).

    Instructions:

    1. On first laptop:
      • Open Settings → Network and Internet → Wi-Fi.
      • Click Additional options.
      • Enable the option Wi-Fi Direct (if it is not there, your adapter does not support the technology).
  • On second laptop:
    • Open the list of Wi-Fi networks.
    • In the section Wi-Fi Direct find the name of the first laptop (eg DESKTOP-ABC123).
    • Connect by confirming the request on the first device.

    Advantages of Wi-Fi Direct:

    • ⚡ Quick connection (no need to enter a password).
    • 🔒 Automatic traffic encryption (WPA2-PSK).
    • 📱 Supports connection of smartphones and tablets.

    Flaws:

    • 🚫 Does not work on adapters older than 2015.
    • 🔌 There is no possibility to distribute the Internet (only direct connection).
    How to check Wi-Fi Direct support?

    Open command prompt and type:

    netsh wlan show drivers

    Find the line in the results Hosted network support. If it is indicated there Yes, then Wi-Fi Direct is most likely supported.

    Method 3: Connecting via a Mobile Hotspot (Internet Sharing)

    If your goal is not just to connect laptops, but to distribute the Internet from one to another, use the built-in mode Mobile hotspotThis method is more stable than Ad-Hoc and is supported by all modern operating systems.

    Setting up on donor laptop (which distributes the Internet):

    1. Connect to the Internet (via Ethernet, 4G modem or mobile hotspot).
    2. Open Settings → Network & Internet → Mobile Hotspot.
    3. In the field Sharing an Internet connection select a source (eg Ethernet).
    4. Click Change → set the network name (SSID) and password (minimum 8 characters).
    5. Turn on the switch Mobile hotspot.

    On second laptop:

    1. Connect to the created network as you would to a regular Wi-Fi.
    2. Check your internet access (for example, by opening a browser).
    ⚠️ Note: In Windows 10/11, the hotspot is disabled by default after 5 minutes of inactivity. To prevent this, change the registry setting:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\WcmSvc\Tethering

    Create a parameter RemoteHostTimeoutMinutes type DWORD and set the value 0.

    Setting up a connection on macOS (via Terminal)

    On laptops MacBook Creating a direct Wi-Fi connection requires the use of TerminalUnlike Windows, there is no graphical interface for Ad-Hoc networks, but the process takes no more than 2-3 minutes.

    Instructions for main MacBook:

    1. Open Terminal (Applications → Utilities → Terminal).
    2. Create a network with the command:
      sudo networksetup -setairportnetwork en0 "MyMacNet" 12345678

      Replace MyMacNet to the network name, and 12345678 — to the password.

    3. Enable hotspot mode:
      sudo ifconfig awdl0 down && sudo ifconfig en0 down && sudo ifconfig en0 up
    4. Allow Internet sharing (if necessary):
      • Open System Preferences → Sharing.
      • Turn on Public Internet.
      • In the field Share connection select Ethernet or Thunderbolt Bridge.
      • In the field For computers using mark Wi-Fi.
  • On second device (Mac or Windows):

    1. Connect to the network MyMacNet via the standard Wi-Fi manager.
    2. When prompted, confirm trust in the network (on macOS).
    3. macOS Features:

      • 🍎 Supports up to 5 devices simultaneously.
      • 🔋 Consumes less power than Windows in hotspot mode.
      • 🚫 Doesn't work on MacBooks older than 2012 (without upgrading the Wi-Fi adapter).

      Checking the connection and troubleshooting

      After connecting, check that the network is working correctly:

      1. Checking IP addresses:
        • On Windows: Open a command prompt and type ipconfigLook for an adapter. Local Area Connection* X (for Ad-Hoc) or Wireless network (for hot spot).
        • On macOS/Linux: enter ifconfig or ip a.

        Both devices must have addresses from the same subnet (for example, 192.168.137.X for Ad-Hoc in Windows).

      2. Ping between devices:
        • Find out the IP address of the second laptop (for example, 192.168.137.2).
        • On the first laptop, run: ping 192.168.137.2.
        • If the packets arrive without loss, the connection is working.
    4. File transfer:
      • Open Conductor (Windows) or Finder (macOS).
      • In the address bar, enter IP address (For example, \\192.168.137.2).
      • If you are prompted for login/password, use the account details of the second laptop.

    Typical problems and solutions:

    Problem Cause Solution
    "Failed to start hosted network" Outdated Wi-Fi driver Update driver via device Manager or the manufacturer's website
    No access to files Public access is disabled Turn on File and Printer Sharing in network settings
    Low transmission speed Interference at 2.4 GHz Switch to 5 GHz (if your adapter supports it) or change the channel manually
    The network disappears after sleep Power saving turns off the adapter Turn it off Allow the device to turn off to save power in the Wi-Fi adapter properties

    Direct Wi-Fi Security: How to Protect Your Data

    A direct Wi-Fi connection is more vulnerable than a router connection because it lacks NAT and basic protection from external attacks. Follow these recommendations to minimize the risks:

    • 🔐 Use a complex password (at least 12 characters, with numbers and special characters).
    • 🛡️ Turn off folder sharing if you don't need it.
    • 🌐 Do not use a direct connection to transfer confidential data (bank documents, passwords).
    • 🔄 Change your network password regularly (especially in public places).

    Additional measures for Windows:

    1. Open Control Panel → Network and Sharing Center → Advanced Sharing Settings.
    2. Select a profile Guest or public.
    3. Turn it off File and Printer Sharing And Network discovery.
    4. Turn on Password protection for general access.

    For macOS:

    1. Open System Preferences → Security & Privacy → Firewall.
    2. Turn on the firewall and add a rule to block incoming connections.
    ⚠️ Warning: In public places (cafes, airports), hackers can intercept traffic on direct Wi-Fi networks. For important data, use VPN or SSH tunneling.

    FAQ: Frequently asked questions about direct laptop connections

    Is it possible to connect a laptop to a Mac and Windows?

    Yes, but with some reservations:

    • If Mac is distributing the network, Windows will connect without problems.
    • If Windows shares the network via Ad-Hoc, on a Mac there may not be an option to connect to such networks (this can be solved by installing a utility Wi-Fi Explorer).
    • For Wi-Fi Direct Compatibility depends on adapters (may not work on MacBooks prior to 2018).

    The best option for cross-platform connection is Mobile hotspot on Windows or Terminal network on macOS.

    Why is file transfer speed low (1-2 MB/s)?

    Reasons and solutions:

    • The adapter operates in 802.11b/g mode.: switch to standard 802.11n (5 GHz) in the driver settings.
    • Interference from other networks: use the utility Wi-Fi Analyzer (Android) or NetSpot (macOS/Windows) to select a free channel.
    • Background processes: Disable OS updates and antivirus software during the transfer.
    • WEP encryption: replace with WPA2-PSK (in the command line when creating a network, specify keyUsage=persistent).

    The maximum speed in an Ad-Hoc network rarely exceeds 20-30 Mbps (~2.5-3.5 MB/s). For large files, use LAN cable or USB-OTG adapter.

    How can I share internet from my laptop to my phone using this connection?

    Yes, this is possible in two ways:

    1. Via Mobile Hotspot:
      • On your laptop, turn on the hotspot (as described in Method 3).
      • On your phone, connect to the created network as you would to a regular Wi-Fi network.
  • Via USB cable (if Wi-Fi is not working):
    • Connect your phone to your laptop via USB.
    • Turn on your phone USB modem (in settings Access point and modem).
    • On your laptop, enable internet sharing for the USB connection.

    On iPhone, connecting to an Ad-Hoc network may require jailbreaking or special utilities (for example, MyWi).

  • Is it possible to play on a local network via a direct Wi-Fi connection?

    Yes, but with restrictions:

    • 🎮 Supported games: Minecraft, Counter-Strike 1.6, Terraria, Starcraft, Worms.
    • 🚫 Inappropriate games: modern online games (Fortnite, Call of Duty) require connection to servers via the Internet.
    • 🔧 Setting up:
      • Create a network using any of the methods described.
      • Launch the game on both laptops.
      • Select mode Local Area Network (LAN).
      • On the first laptop, create a server, and on the second, connect to its IP address.

    To reduce lags:

    • Use 5 GHz (if adapters support it).
    • Disable background programs (Torrent, cloud synchronization).
    • Reduce the graphics settings in the game.
    How to disable direct connection after use?

    Methods depending on the method:

    • Ad-Hoc (Windows):
      netsh wlan stop hostednetwork

      Or restart your laptop.

    • Mobile hotspot:

      Open Settings → Network & Internet → Mobile Hotspot and turn off the switch.

    • Wi-Fi Direct:

      Disable the option in Settings → Network & Internet → Wi-Fi → Advanced settings.

    • macOS:
      sudo networksetup -setairportpower en0 off

      Or turn it off Public Internet in system settings.

    Once disconnected, the network will disappear from the list of available Wi-Fi networks on the second device.