Nettop is a lightweight Linux-first network monitoring TUI with a scriptable CLI controller. It captures traffic, ranks source IPs, tracks PPS and byte rates, shows MAC activity, and resolves IP geography from Nettop's own offline location.csv.
python3 -m pip install -e .[full]
sudo nettop run --dst 0.0.0.0 --port 0 --iface eth0Rootless demo:
nettop demoChange a running monitor:
nettopctl status
nettopctl set --dst 192.168.1.10 --port 80,443
nettopctl top 50
nettopctl pause
nettopctl resume
nettopctl snapshot
nettopctl stopInside the TUI, use:
d change destination IP
p change destination ports
s change source IP
y change protocol filter
t change top row count
space pause/resume
r reset counters
q quit
The default geo database is bundled at:
nettop/location.csv
The resolver is pure Python standard library code. It loads CIDR or start/end ranges, searches them in memory, and returns country, city, ASN, and organization fields when present.
CSV format:
cidr,country_code,country,city,asn,org
8.8.8.0/24,US,United States,,AS15169,Google
1.1.1.0/24,AU,Australia,,AS13335,CloudflareAlternative range format:
start,end,country_code,country,city,asn,org
8.8.8.0,8.8.8.255,US,United States,,AS15169,GoogleUse a custom database:
sudo nettop run --location-db /opt/nettop/location.csvUpdate from DB-IP Lite:
sudo nettop update-db --output /var/lib/nettop/location.csv --kind cityThe systemd timer in packaging/systemd/nettop-db-update.timer runs that update weekly. DB-IP Lite downloads are updated monthly, so the weekly job checks for the latest available monthly release and keeps the installed database fresh.
Private, loopback, link-local, multicast, reserved, and invalid IPs are classified locally with Python's ipaddress module.
Core live metrics include:
- total packets, bytes, current PPS, average PPS, byte rate
- unique source IPs, destination IPs, protocols, ports, TCP flags, packet sizes
- per-IP packets, bytes, current PPS, 10-second PPS, 60-second PPS, low PPS, peak PPS, first/last nanosecond timestamps
- MAC packet counts, MAC current PPS, MAC 60-second PPS
- country ranking, local/private IP classification, optional ASN/org data from
location.csv - alerts for new IPs, new MACs, and high PPS
Print the full catalog:
nettop featuresUbuntu install:
sudo add-apt-repository ppa:najuaircrack/nettop
sudo apt update
sudo apt install nettopOther install:
curl -fsSL https://nettop.cybroxa.com/nettop.gpg \
| sudo gpg --dearmor -o /usr/share/keyrings/nettop.gpg
echo "deb [signed-by=/usr/share/keyrings/nettop.gpg] https://nettop.cybroxa.com stable main" \
| sudo tee /etc/apt/sources.list.d/nettop.list
sudo apt update
sudo apt install nettopDeveloper install:
git clone https://github.com/najuaircrack/Nettop.git
cd Nettop
python3 -m pip install .[full]System service files are in packaging/systemd. Debian metadata is in packaging/debian; use it as the starting point for building a .deb and publishing it through your own APT repository.
On a Debian/Ubuntu build host:
sudo apt install build-essential debhelper dh-python python3-all python3-setuptools python3-rich python3-scapy pybuild-plugin-pyproject
cp -r packaging/debian ./debian
dpkg-buildpackage -us -ucThen publish the generated .deb in an APT repository using your normal repo tooling, such as reprepro or aptly.
nettop doctor
nettop demo --top 30 --interval 0.5
sudo nettop run --dst 10.0.0.5 --port 22,80,443 --jsonl /var/log/nettop/events.jsonl
sudo nettop run --pcap capture.pcap --no-geoThe code is modular:
nettop.capture: Scapy capture, raw socket fallback, demo traffic, PCAP replaynettop.store: thread-safe counters and PPS windowsnettop.geo: offline resolver backed by Nettop's CSV modulenettop.puregeo: dependency-free CSV/range resolvernettop.control: Unix socket runtime controllernettop.tui: responsive Rich dashboardnettop.exporters: JSON/CSV/JSONL exportnettop.alerts: lightweight alert engine