A comprehensive, standalone command-line tool to diagnose P2P networking issues. This tool provides detailed analysis of network connectivity, NAT behavior, and port mapping for P2P protocols.
Developed by NeuronInnovations - Advanced P2P networking diagnostics for modern applications.
The tool performs the following advanced diagnostic tests:
- Internet Connectivity - Tests basic internet access
- Local Network Interface - Checks for active network interfaces and IP addresses
- Port Availability - Tests specific P2P ports (61336-61346 range) with alternative detection
- NAT Type Detection - STUN-based NAT detection with port mapping analysis
- UPnP Router Support - Tests UPnP discovery capability
- DNS Resolution - Verifies DNS functionality
- UDP Connectivity - Real UDP connectivity testing with echo verification
- Relay Echo Test - Tests connectivity to relay/echo servers
- P2P Communication - Tests local UDP communication within port range
- Firewall Analysis - Comprehensive firewall blocking detection
./network-diagnostics 61340./network-diagnosticsgo run network-diagnostics.go 61340make diagnostics # Run directly
make run # Build and run
make build # Just buildThe tool provides clear, color-coded output:
- ✅ OK - Test passed
⚠️ WARNING - Test passed but with potential issues- ❌ NOT OK - Test failed
Example output:
🔍 P2P Network Diagnostics Tool
=================================
✅ Internet Connectivity: OK
Internet connection working
Details: Successfully connected to external network
⚠️ NAT Type Detection: WARNING
Behind NAT (private IP detected)
Details: Local IP: 192.168.1.100, Private: true
📊 SUMMARY
==========
✅ Tests Passed: 6
⚠️ Tests with Warnings: 1
❌ Tests Failed: 1
📈 Success Rate: 75.0%
⚠️ Some warnings detected, but network should work for P2P.
Consider configuring port forwarding for better connectivity.
- Port Blocking: Configure your router to forward the required ports
- NAT Issues: Enable UPnP on your router or manually configure port forwarding
- Firewall: Check Windows Firewall or antivirus software settings
- ISP Restrictions: Contact your ISP if you're behind a restrictive NAT
The tool specifically detects port mapping issues where your local port doesn't match your public port:
⚠️ PORT MAPPING: Local port 61340 != Public port 54321
This may cause issues for your protocol!
Why routers do port mapping:
- Security: Prevents direct port scanning and attacks
- Load Balancing: Distributes traffic across multiple internal servers
- Port Conflicts: Avoids conflicts when multiple devices use same ports
- ISP Policies: Some ISPs implement port mapping for traffic management
The tool tests the P2P port range 61336-61346:
- Tests your specific port first
- Finds alternatives if your port is blocked
- Suggests closest available alternative
- Go 1.19 or later
- Windows, macOS, or Linux
- Internet connection for testing
# Windows
make build-windows
# Linux
make build-linux
# macOS
make build-macThis tool follows the Keep It Simple, Stupid principle:
- Single file with no external dependencies
- Clear, actionable output
- No complex configuration required
- Immediate results
Pre-compiled binaries are available in the Releases section:
- Windows:
network-diagnostics-windows.exe - macOS:
network-diagnostics-macos - Linux:
network-diagnostics-linux
This project is licensed under the MIT License - see the LICENSE file for details.
Issues and pull requests are welcome! This tool is designed to help the P2P community diagnose networking issues.