portcheck - Port Scanner

Fast TCP port connectivity checker for troubleshooting.

Quick Start

portcheck router 22 80 443
portcheck server 22-25
portcheck --common server

Usage

portcheck <host> <port> [port...]    # Check specific ports
portcheck <host> <start>-<end>       # Check port range
portcheck --common <host>            # Check common ports
portcheck -t 2 <host> <port>         # Custom timeout (seconds)

Options

Option Description

--common

Check common ports: 22, 80, 443, 3389, 8080, 8443, 3306, 5432, 6379, 27017

-t SECONDS

Connection timeout (default: 3)

Examples

Check Specific Ports

portcheck 192.168.1.1 22 80 443
Output
Checking 192.168.1.1 (3 ports, timeout=3s)

  🟢 22/tcp open
  🟢 80/tcp open
  🟢 443/tcp open

Open: 3, Closed: 0
Open ports: 22, 80, 443

Check Port Range

portcheck mail.example.com 25 110 143 993 995

Common Ports Scan

portcheck --common 10.0.0.1

Quick Check with Short Timeout

portcheck -t 1 host.example.com 22

Performance

Ports are checked in parallel (up to 20 concurrent connections) for speed.

Dependencies

None - uses Python standard library sockets.