Identifying Your Local IP Address
The first step in establishing a local connection is knowing exactly which IP address your Windows PC has received from your router. This address is typically in the format192.168.x.x, 10.x.x.x, or 172.16.x.x. You can retrieve this information quickly through the Command Prompt or PowerShell. Open your start menu, type cmd, and press Enter. In the black window that appears, type ipconfig and hit Enter. Look for the section corresponding to your active network adapter, whether it is labeled "Wi-Fi" or "Ethernet." Find the line that says IPv4 Address and write down that number. If you are unsure which adapter is active, check which one shows an IP address while others show 0.0.0.0 or N/A.
It is important to note that if your router assigns dynamic addresses via DHCP, this IP might change after a reboot. For a more stable experience, consider configuring a static IP reservation in your router settings, though this is optional for basic testing. If you encounter issues with network discovery, such as those described in Resolving Windows 10 Local Network Sharing Issues, ensuring your network profile is set to "Private" rather than "Public" is crucial. Public networks block most inbound connections by default, which will prevent other devices from seeing your server.
Configuring the Game Server Software
Most game servers require specific configuration to accept connections from local clients. Open the configuration files for your game server, often namedserver.cfg, config.json, or similar, located in the installation directory. Look for settings related to the bind address or listen IP. Common values include 0.0.0.0, which tells the server to listen on all available network interfaces, or your specific local IP address identified in the previous step. Avoid setting the bind address to 127.0.0.1 (localhost), as this restricts connections to only the machine running the server.
If the server software does not have a specific bind setting, it usually defaults to listening on all interfaces. However, you must verify that the server is actually running and listening on the correct port. You can do this by opening another Command Prompt window and typing netstat -ano | findstr :, replacing with the actual port your game uses (e.g., 25565 for Minecraft). If you see output indicating the port is LISTENING, the server is ready to accept connections. If you do not see any output, the server may be failing to start or binding to an unexpected interface.
Adjusting Windows Firewall Settings
Windows Defender Firewall is the most common reason local connections fail, even when the IP and server settings are correct. By default, Windows blocks incoming connections to applications unless explicitly allowed. To fix this, open the Start menu and search for "Windows Defender Firewall with Advanced Security." Click on Inbound Rules in the left pane. Look for a rule associated with your game server executable. If it exists, ensure it is enabled. If it does not exist, you need to create a new rule. Click New Rule... on the right side. Select Port and click Next. Choose TCP or UDP depending on your game server requirements, and enter the specific port number. Click Next, then select Allow the connection. Ensure that the rule applies to Domain, Private, and Public networks, although Private is sufficient for local play. Name the rule clearly, such as "Game Server Port," and finish the wizard. Alternatively, if you prefer a command-line approach, you can use thenetsh utility to add rules programmatically, similar to how one might adjust MTU settings as seen in Trying to Change MTU: netsh int ipv4 set subinterface "WiFi" mtu=1500 store=persistent.
Connecting from Another Device
Once the server is running and the firewall is configured, you can join from another device on the same network. On the client device, open the game and look for the multiplayer or server list menu. Instead of searching for a public server, look for an option to "Join by IP" or "Direct Connect." Enter the local IP address of your Windows PC and the server port, separated by a colon (e.g.,192.168.1.15:25565). If the connection succeeds, you will see the game world load. If it fails, double-check that both devices are on the same subnet and that no intermediate hardware, such as a guest network isolation feature on your router, is blocking traffic between them.
Frequently Asked Questions
Why can't I connect using my public IP?
Your public IP is assigned by your Internet Service Provider and represents the gateway to the entire internet. Connecting via public IP requires complex port forwarding configurations and exposes your home network to external threats. Using the local IP is safer and faster for players within the same household.
What if my local IP changes after a restart?
If your router uses DHCP, the IP may change. To prevent this, log into your router's admin panel and set up a DHCP reservation for your PC's MAC address. This ensures your PC always receives the same local IP address, making the connection process consistent.
How do I check if the firewall is blocking me?
You can temporarily disable the Windows Firewall to test if it is the cause. If the connection works with the firewall off, you know you need to add an inbound rule. Always re-enable the firewall immediately after testing to maintain security.
Can I connect if my friends are on a different Wi-Fi network?
No, local IPs are only reachable within the same subnet. If your friends are on a different network, they cannot reach your local IP directly. You would need to use a VPN service like Hamachi or rely on the game's official matchmaking servers instead.
Does enabling "File and Printer Sharing" help?
No, file sharing protocols are distinct from game server ports. While they both rely on network visibility, enabling file sharing does not automatically open the specific UDP or TCP ports required by game servers. You must configure the firewall rules specifically for the game's port.