A lightweight PowerShell script to detect and record network exit IP status
without relying on browsers or proxy-aware tools.
It helps identify LAN IP, China direct exit IP, Japan direct exit IP,
and proxy exit IP, with idempotent logging for long-term observation.
- Detect local LAN IPv4 address
- Identify China direct exit IP (HTTP, PAC-unaffected)
- Multi-API voting to determine international direct exit IP
- Detect proxy exit IP via blocked HTTPS endpoint
- PAC / proxy status classification
- Idempotent log writing (no duplicate records)
- No browser or GUI dependency
Each log record contains:
REAL_LAN– Local LAN IPv4 addressCN_EXIT– China direct exit IPJP_DIRECT_EXIT– Direct international exit IP (consensus)PROXY_EXIT– Proxy exit IPSTATUS– Network status classification
| STATUS | Meaning |
|---|---|
NO_PROXY |
No proxy detected |
MIXED_PROXY |
Proxy exit differs from direct exit |
PAC_ONLY_BLOCKED |
PAC blocks HTTPS but direct exit unchanged |
UNKNOWN |
Insufficient data |
2026-02-05 03:11:22 | REAL_LAN=192.168.1.10 | CN_EXIT=1.2.3.4 | JP_DIRECT_EXIT=5.6.7.8 | PROXY_EXIT=9.9.9.9 | STATUS=MIXED_PROXY
Run the following command in PowerShell:
powershell -ExecutionPolicy Bypass -File ip-log.ps1
The script writes records to log.txt in the same directory.
- Verify PAC / proxy routing behavior
- Observe network exit changes over time
- Diagnose mixed proxy environments
- Lightweight network exit auditing on Windows
MIT License