A real-time terminal user interface (TUI) application for monitoring network connections, similar to netstat -alp but with a modern, interactive interface.
- Dual-panel layout:
- Top panel: Listening ports/services (shows only local addresses)
- Bottom panel: Active connections (shows local, remote addresses and states)
- Real-time updates: Network connections are refreshed every second
- Color-coded states: Different connection states are highlighted with colors
- Green: LISTEN (listening sockets)
- Cyan: ESTABLISHED (active connections)
- Yellow: TIME_WAIT (connections in time-wait state)
- Red: CLOSE_WAIT (connections waiting to close)
- Process information: Shows PID and process name for each connection
- Clean interface: Organized table layout with clear column headers
# Run in development mode
cargo run
# Or run the optimized release binary
./target/release/netmon-tui- q or Esc: Quit the application
Top Panel - Listening Ports:
- Proto: Protocol type (TCP, TCP6, UDP, UDP6)
- Local Address: Local IP address and port
- PID/Program: Process ID and name using the port
Bottom Panel - Active Connections:
- Proto: Protocol type (TCP, TCP6, UDP, UDP6)
- Local Address: Local IP address and port
- Foreign Address: Remote IP address and port
- State: Connection state (ESTABLISHED, TIME_WAIT, etc.)
- PID/Program: Process ID and name using the connection
- Rust 1.70+ (installed via rustup)
- Linux system (uses /proc/net/* files)
# Development build
cargo build
# Release build (optimized)
cargo build --release- ratatui: Terminal UI framework
- crossterm: Cross-platform terminal manipulation
- tokio: Async runtime for smooth updates
- anyhow: Error handling
The application parses network information directly from Linux's /proc/net/ filesystem:
/proc/net/tcpand/proc/net/tcp6for TCP connections/proc/net/udpand/proc/net/udp6for UDP sockets
Process information is resolved by matching socket inodes from /proc/[pid]/fd/ entries.
This project is open source and available under standard Rust project licensing.