Python CLI · Windows / Linux / macOS
Check connectivity from where you actually work.
A lightweight Python command-line utility for IPv4/IPv6 reachability through ICMP Ping or a single TCP port — from your own device and network.
Real checks run locally. This website does not probe IP addresses. Your computer, a VPN-connected workstation and a remote server can each see a different network.
- 01 / ORIGINThe machine running PythonYour laptop, workstation or server
- 02 / PATHThat machine’s networkRouting · VPN · firewall policy
- 03 / DESTINATIONOne explicit IP addressICMP or one selected TCP port
Static architecture illustration.
No measurement is running here.
01 / Two methods
Ask a precise question.
Supply explicit IP literals. Python validates and deduplicates them, applies bounded concurrency, then runs the selected check from your local machine. Results retain input order.
- ICMP Ping
- Invokes the operating system’s ping utility without a shell. A successful process outcome reports reachable. ICMP may be blocked even when a host is operational.
- Single-port TCP
- Attempts one connection to the selected IP and port using Python’s standard library. Success confirms that connection, not application health or every service on the host.
No CIDR expansion. No DNS reconnaissance. No multi-port scan. No remote monitoring endpoint.
02 / Start locally
Your runtime.
Your network.
Python 3.10+ and Git. No third-party runtime packages. ICMP also needs the OS ping utility on PATH.
Run these commands on the computer whose connectivity you want to evaluate. Loopback 127.0.0.1 and ::1 refer to that machine itself, not this website.
Windows · PowerShell
git clone https://github.com/AlirezaBelal/ip-reachability-checker.git
cd ip-reachability-checker
py -3 --version
py -3 ip_reachability_checker.py 127.0.0.1 --count 1Use Python 3.10 or newer. If your installation uses python, substitute it for py -3.
macOS / Linux · Terminal
git clone https://github.com/AlirezaBelal/ip-reachability-checker.git
cd ip-reachability-checker
python3 --version
python3 ip_reachability_checker.py 127.0.0.1 --count 1Use Python 3.10 or newer. On minimal Linux installations, install the OS ping utility for ICMP, or use TCP mode.
One port, one connection question
python ip_reachability_checker.py 127.0.0.1 --tcp-port 8000Port 8000 needs an actual local listener to be reachable. Use the Python executable selected above. This command does not start a server.
IPv6, target files and JSON
python ip_reachability_checker.py ::1 --count 1
python ip_reachability_checker.py --file targets.example.txt --workers 4
python ip_reachability_checker.py 127.0.0.1 --tcp-port 8000 --jsonUTF-8 files accept one IP per line. Blank lines and lines starting with # are ignored but count toward the line budget. The example file also contains a reserved documentation address; review any file and supply only authorized targets.
03 / Read the evidence
A signal.
Not a diagnosis.
- reachable
- The OS ping returned success, or the selected TCP connection completed.
- unreachable
- A normal unsuccessful ping, timeout or network connection failure. It does not uniquely identify the cause.
- error
- The check could not operate: for example, a missing ping executable or a local socket resource error.
Illustrative JSON · not a live result
{
"results": [{
"detail": "port 8000",
"ip": "127.0.0.1",
"latency_ms": 0.42,
"method": "tcp",
"status": "reachable"
}],
"summary": {
"error": 0, "reachable": 1,
"total": 1, "unreachable": 0
}
}Example shape for a successful connection to an existing local listener; values are illustrative.
latency_ms is a historical compatibility field for overall check duration. For ICMP it includes process startup and packet spacing; it is not packet RTT. Text output calls it duration.
Exit codes for automation
- 0
- All targets reachable
- 1
- At least one unreachable
- 2
- Invalid input/configuration or a check error
- 130
- Interrupted with Ctrl+C
Errors take precedence over unreachable results. Ctrl+C returns after active bounded checks finish; it does not immediately cancel running threads.
04 / Interpret carefully
The route is part of the result.
- Home and corporate networks
Internal routing and firewall policy can produce different outcomes for the same destination.
- VPN connections
A VPN can change the route. A successful check from one device does not guarantee the same result from another.
- Remote servers
A remote run measures that server’s connectivity, not the browser visitor’s or the developer’s laptop.
- Timeouts and services
Failure can reflect routing, a firewall, an absent listener or another cause. ICMP failure does not establish host failure; TCP success is specific to the chosen port.
05 / Bounded by design
Explicit targets.
Deliberate limits.
- 256unique IP literals per run
- 32maximum concurrent workers
- 1TCP port per run
- 4,096 / 512file lines / characters per line
Strict validation precedes execution. Ping uses an argument array without a shell. Target files are streamed with bounded reads. Timeouts and packet counts are bounded; raw ping output is not parsed or persisted.
ICMP response waits differ by OS. Each ping process also has an overall deadline. The timing reference documents rounding and macOS IPv6 behavior.
Tests use mocks and temporary localhost listeners. CI verifies Python 3.10–3.14 and real loopback ICMP on Windows, macOS and Linux. Only check systems and networks where you have authorization.
Read the guide. Run the real tool.
Start from your own machine.
This static website has no probe form, network endpoint or live diagnostic service.