How to Connect Two Laptops via Wi-Fi: A Complete Guide

Creating a local connection between two computers without a router is a task that may seem complicated, but in practice it can be accomplished in a few minutes. Direct connection Wi-Fi adapters allow you to not only share files at high speeds but also collaborate on documents or even play online games. This is ideal for offices without wired infrastructure or for quickly transferring data on the fly.

Modern operating systems such as Windows 10 And Windows 11, have built-in tools for implementing this function, but their settings are often hidden deep within system settings. You won't need to purchase additional equipment or special cables if both devices are equipped with wireless modules. The main thing is to set the security parameters and network addresses correctly.

In this article, we'll cover all the steps involved in creating a connection, from choosing a network topology to setting up access to shared resources. The key is to correctly configure IP addresses in static mode, since without a router there will be no DHCP server that distributes addresses automatically. Please follow the instructions carefully to avoid address conflicts.

Choosing a Network Topology: Ad-Hoc vs. Infrastructure Mode

Before you begin setting up your devices, you need to understand how you'll be connecting them. There are two main wireless connection options, and the choice depends on whether you have a router. If you don't have a router, use the wireless mode. Ad-Hoc (computer-to-computer) where one laptop broadcasts a signal and the second one connects to it.

When both laptops are connected to the same Wi-Fi router, infrastructure mode is used. Here, the setup is limited to minimizing security requirements so that the devices can "see" each other. In this case, one computer acts as an access point, which may slightly increase the load on its network adapter.

To establish a direct connection in Windows 10 and newer, the standard interface for creating a new network has been deprecated, so Ad-Hoc mode often requires the use of the command line or third-party utilities. However, if both devices are on the same Wi-Fi network (via a router), the process is significantly simplified and only requires configuring sharing settings.

⚠️ Attention: When using Ad-Hoc mode, the network range will be limited by the power of the Wi-Fi adapter of the "distributing" laptop, usually 10-15 meters within line of sight.

Let's look at the main differences in approaches:

  • 📡 Ad-Hoc mode: It is created directly between devices, does not require a router, and is more difficult to set up on newer operating systems.
  • 🏠 Infrastructure mode: A Wi-Fi router is required, both laptops are connected to it, the setup is simpler and more stable.
  • 🔒 Safety: In Ad-Hoc mode, encryption is configured manually; in infrastructure mode, it depends on the router settings.
📊 What type of connection do you plan to use?
Direct (without router)
Via a Wi-Fi router
I just need to transfer a file
I use Mac and Windows

Setting up a network via the command line (Ad-Hoc mode)

If you don't have a router, you'll have to create a virtual access point manually. In modern versions of Windows, this can be done via the command prompt with administrator privileges. Open a terminal and enter the following command to check for hosting support: netsh wlan show driversThe "Hosted Network Support" line should say "Yes".

Next, you need to create a new network. To do this, use a command specifying the network name (SSID) and password. The password must be at least 8 characters long. An example command looks like this:

netsh wlan set hostednetwork mode=allow ssid=MyLocalNet key=Password123

After creating the network, you need to start it with the command netsh wlan start hostednetworkOn the second laptop, the hotspot you created will appear in the list of available Wi-Fi networks. MyLocalNetConnect to it using the specified password.

☑️ Ad-Hoc Network Creation Checklist

Completed: 0 / 5

It is important to understand that after a reboot, the created network may disappear, and the startup procedure (start hostednetwork) will have to be repeated. To automate this process, users often create batch files. It's also worth keeping in mind that some antivirus programs may block such connections, considering them potentially dangerous.

Configuring IP addresses for direct connection

Once the laptops are connected via Wi-Fi (or connected to the same router), the system needs to be told how to transfer data. In router-less mode, there is no DHCP server, so IP addresses must be entered manually. This is a critical step, as pinging between the devices will not work without it.

Go to the Wi-Fi adapter settings on the first laptop. Find the protocol Internet Protocol version 4 (TCP/IPv4) and open its properties. Select the "Use the following IP address" option and enter the following information:

  • 🔢 IP address: 192.168.137.1
  • 📏 Subnet mask: 255.255.255.0
  • 🌐 Gateway: You can leave it blank or specify your IP

On the second laptop, the steps are similar, but the IP address must differ in the last digit. For example, use 192.168.137.2. The subnet mask remains the same. In this case, you can omit DNS servers or use your provider's primary DNS address (e.g., 8.8.8.8), although this is not required for local file transfers.

⚠️ Important: Make sure the last digit of the IP address (host) on both devices is different. If both have .1, an address conflict will occur and the network will not work.

You can check the correctness of the settings using the utility pingOpen a command prompt on the first laptop and enter ping 192.168.137.2If you see the response "Response from...", then the physical and logical connection has been established successfully.

What to do if ping doesn't work?

If ping commands return a "Timeout exceeded" error, check your Windows Firewall. It often blocks ICMP requests on public networks. Try temporarily disabling the firewall or allowing ping requests in your network security settings. Also, make sure the network type is set to "Private" and not "Public."

Setting up sharing and opening folders

Now that the laptops can see each other, you need to enable file sharing. In Windows, this is done through the Network and Sharing Center. Go to "Advanced Sharing Settings" and ensure that network discovery and file and printer sharing are enabled for the current profile (Private network).

To disable the password prompt when logging in from another computer, find the "All Networks" section and select "Turn off password-protected sharing." This will make connecting easier, but it will reduce security if others have access to your Wi-Fi network.

To share a specific folder, right-click on it, select Properties → Sharing tab → Share button. Add a user. All and set read or read and write permissions. The folder path will now be accessible over the network.

To access another laptop's resources, open File Explorer and enter the remote machine's IP address in the address bar, for example: \\192.168.137.2If everything is configured correctly, you will see the shared folders.

Comparison of connection methods and their characteristics

Different communication methods have their advantages and disadvantages depending on your goals. Below is a table to help you choose the best method for your situation.

Parameter Direct Wi-Fi (Ad-Hoc) Via a router (Infrastructure) Ethernet cable
Transfer speed Average (depending on adapter) High (depending on the router) Maximum (stable)
Necessary equipment Laptops only Wi-Fi router Cable (twisted pair)
Difficulty of setup High (IP, CMD required) Low (automatic) Low (automatic)
Mobility High Limited to Wi-Fi zone Low (cable tethered)

As the table shows, a cable connection always wins in terms of speed and stability, but loses in convenience. A Wi-Fi connection via a router is the "golden mean" for most users. A direct connection is useful in emergency situations or when infrastructure is lacking.

It is worth noting that the speed of a wireless connection also depends on the standard Wi-FiIf both laptops support the standard 802.11ac or 802.11ax, the speed will be significantly higher than when using the old standard 802.11n.

Troubleshooting and diagnosing problems

Even if you follow the instructions exactly, problems may arise. Most often, they are related to Windows network profiles. If the system considers your network "Public," it automatically blocks incoming connections for security. Switch the profile to "Private" in the Wi-Fi settings.

Another common issue is different workgroups. Although this requirement has become less stringent in modern Windows, to ensure that computers are visible in the network environment, it's best to have both devices assigned to the same workgroup (the default). WORKGROUP). You can change this in the system properties.

If the computers can't see each other, try temporarily disabling your antivirus software. Third-party firewalls often have their own rules that override Windows system settings. Also, make sure the Discovery Resource Publishing and Search services are running.

⚠️ Note: Menu interfaces and names may vary depending on your Windows version and security updates. If you can't find the option, search for it in Settings or refer to the official Microsoft documentation for your OS version.

For diagnostics use the command ipconfig in the command line to ensure that the adapter has received an address from the correct subnet. The command netstat -n, which will show active connections and listening ports.

Questions and Answers (FAQ)

Is it possible to connect a Windows laptop and a MacBook via Wi-Fi?

Yes, this is possible. Both devices must be connected to the same Wi-Fi network. On a Mac, you need to enable "File Sharing" in System Preferences. To connect from Windows, use smb://Mac-IP-Address in the File Explorer address bar. You will need to enter the Mac username and password.

Why is file transfer so slow?

Speed ​​may be limited by Wi-Fi range (2.4 GHz is slower than 5 GHz), distance between devices, or interference. Also, make sure your antivirus software isn't scanning every transferred file in real time, which can significantly slow down the process.

Is it safe to leave sharing enabled all the time?

If you're on a home network with a strong Wi-Fi password, the risks are minimal. However, in public places (cafes, airports), it's strongly recommended not to leave your Wi-Fi open, as hackers on the same network could access your files.

How to disable the created Ad-Hoc network?

To stop the virtual access point, enter the command in the command line netsh wlan stop hostednetworkTo completely remove the network configuration, use the command netsh wlan set hostednetwork mode=disallow.

Is internet required for a local network to function?

No, internet access is not required. The local network works regardless of whether you have access to the internet. The main thing is that the network adapters are working properly and the drivers are installed correctly.