sodcalculator

10 Tech How-To

PC to PC LAN Cable: How to Connect

Guide 10-50494 · Updated · Step by step

Connecting two PCs directly with a LAN cable lets you transfer files, share an internet connection, or set up a small network without a router or switch. This guide covers the physical connection, the required network settings for both Windows and macOS, and how to troubleshoot common issues. You’ll need an Ethernet cable (a crossover cable for older hardware, though most modern NICs auto-negotiate) and administrative access to both computers.

What You’ll Need

  • An Ethernet cable (Cat5e, Cat6, or higher). For most modern computers, a standard straight-through cable works because of Auto-MDI/X. If you have older equipment (pre-2000s), use a crossover cable.
  • Two computers with Ethernet ports (or a USB-to-Ethernet adapter if not built-in).
  • Administrator account access on both machines to change network settings.

Step-by-Step

  1. Physically connect the computers. Plug one end of the LAN cable into the Ethernet port of the first PC and the other end into the second PC. You should see link lights (usually green/orange) on both ports, indicating a physical connection.
  2. Verify the network adapter is enabled. On both PCs, open the Network settings. In Windows, go to Settings > Network & Internet > Ethernet and confirm the adapter is enabled. On macOS, go to System Settings > Network and check that Ethernet is active.
  3. Assign static IP addresses. Since there’s no router to assign IPs automatically, you must set them manually. On the first PC, open the adapter properties (Windows: Control Panel > Network and Sharing Center > Change adapter settings > right-click Ethernet > Properties > Internet Protocol Version 4 (TCP/IPv4) > Properties). Select “Use the following IP address” and enter:
    • IP address: 192.168.1.1
    • Subnet mask: 255.255.255.0
    • Default gateway: leave blank (or 192.168.1.1 if needed)

    On the second PC, do the same but use 192.168.1.2 as the IP address, same subnet mask.

  4. Set the same workgroup (Windows only). For file sharing, both PCs should be in the same workgroup (default is WORKGROUP). Go to Settings > System > About > Rename this PC (or advanced system settings) and ensure the workgroup name matches.
  5. Enable file sharing. On Windows, go to Control Panel > Network and Sharing Center > Advanced sharing settings and turn on network discovery and file and printer sharing. On macOS, go to System Settings > General > Sharing and enable File Sharing.
  6. Share a folder. Right-click the folder you want to share, select Properties > Sharing > Share, and add the user “Everyone” with read/write permissions (or a specific user). On macOS, add the folder to the Shared Folders list in File Sharing settings.
  7. Test the connection. Open a command prompt (Windows) or terminal (macOS) and ping the other PC’s IP address: ping 192.168.1.2 (from the first PC). You should get replies. If not, check the firewall or the cable.
  8. Access the shared folder. In Windows File Explorer, type \\192.168.1.2 (or the computer name) in the address bar. On macOS, press Cmd+K and enter smb://192.168.1.2. You’ll see the shared folders.

Common Mistakes

  • Using a crossover cable on modern hardware. Most NICs auto-detect, but if you have a very old PC, a crossover cable is required. If you’re unsure, try a straight-through cable first; if it doesn’t link, try a crossover.
  • Wrong IP subnet. Both IPs must be in the same subnet (e.g., 192.168.1.x with mask 255.255.255.0). If one is 192.168.1.5 and the other is 192.168.2.5, they won’t see each other.
  • Firewall blocking ping or file sharing. Windows Firewall or third-party security software can block ICMP and SMB. Temporarily disable the firewall to test, then add exceptions.
  • Forgetting to enable network discovery. Even with correct IPs, file sharing won’t work if discovery is off.
  • Using a cable that’s too long or damaged. Ethernet max length is 100 meters; a damaged cable can cause intermittent links.

Tips

  • Use a static IP for both PCs to avoid conflicts, especially if you later connect to a router.
  • For faster transfers, use a Cat6 cable if your NICs support gigabit speeds.
  • If you only need to transfer files once, consider using a USB drive instead—it’s simpler.
  • Write down the IPs you assign; you’ll need them later.
  • On Windows, you can also use the “Nearby Sharing” feature, but it requires Bluetooth/Wi-Fi and is less reliable for large files.

Troubleshooting

  • No link light on the Ethernet port. Check the cable is firmly seated. Try a different cable. If still no light, the port may be disabled in BIOS or the driver may be missing. Check Device Manager (Windows) or System Information (macOS).
  • Ping fails. First, verify IP settings on both PCs. Then, temporarily disable Windows Firewall (or macOS application firewall) and ping again. If that works, add exceptions for File and Printer Sharing.
  • File sharing shows “network path not found.” Ensure you’re typing the correct IP or name. Try using the IP address instead of the computer name. Also, check that the shared folder exists and permissions are set.
  • One PC has internet, the other doesn’t. This setup doesn’t share internet by default. To share internet, you need to enable Internet Connection Sharing (ICS) on the PC with internet, which will assign a different IP range (192.168.137.x). If you want both to have internet, use a router instead.
  • Slow transfer speeds. Check the link speed in the adapter status. If it’s 100 Mbps instead of 1 Gbps, the cable may be damaged or the NIC doesn’t support gigabit. Also, large numbers of small files transfer slower than one large file.

Frequently Asked Questions

Do I need a crossover cable?

Only if you have very old computers (pre-2000) that don’t support Auto-MDI/X. Modern NICs automatically detect the cable type and work with a standard straight-through cable.

Can I connect a PC to a Mac with a LAN cable?

Yes. The physical connection is the same. Assign static IPs in the same subnet, enable file sharing on both, and use SMB protocol (Windows) or AFP (older Macs) to access shared folders.

How do I share an internet connection?

On the PC with internet, enable Internet Connection Sharing (ICS) on the network adapter that has internet. This will create a DHCP server on the LAN port, and the other PC will get an IP automatically. Note that ICS uses a specific IP range (192.168.137.x).

What is the maximum cable length?

For Ethernet, the maximum length is 100 meters (328 feet) for a single segment. Beyond that, you need a switch or repeater.

Can I use a LAN cable to play games between two PCs?

Yes, you can set up a LAN game. Assign static IPs, then in the game’s multiplayer options, select LAN and join by IP. This works for many games that support LAN play.

Why can’t I see the other computer in Network Neighborhood?

Network discovery might be off, or the workgroup name differs. Also, ensure both PCs are on the same subnet. Using the IP address directly (e.g., \\192.168.1.2) is more reliable than browsing.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →