lanwatch: a network monitor that fits in 3 MB

·

Also available in Spanish: leer en castellano.

Every home network is a small city you never see. Phones come and go, a smart plug you forgot you owned still chats with the router, and somewhere there is a device nobody can name. I wanted a window onto that city, one I could open from the terminal of a small Orange Pi that is always on, without installing a server, a database or a web dashboard to look after.

I looked for something that would do it comfortably, and nothing pleased me. Some tools were heavy, some wanted a browser, some did one thing well and left me to glue together the rest. So I wrote the one I wanted. lanwatch is a network monitor for the terminal, native and tiny: a single static binary of about 3 MB, with no dependencies and no daemons.

On an Orange Pi Zero 3 it uses about 3.6 MB of RAM and about 1 % of one core on average with the interface open, and that includes a full sweep of the network every minute.

Eight tabs, one window

  • Devices: every machine on the LAN with its IP, MAC, vendor (decoded from the MAC with the embedded IEEE database), name, operating system, open ports and traffic. The OS is identified by asking the machine itself over mDNS, NetBIOS and UPnP, and estimated from ports and TTL when it will not say.
  • Gateway: the router’s inbound and outbound traffic with rate, peak, total and a graph, over SNMP.
  • DNS: compares the latency and answers of your system DNS and any others you add.
  • Speed: latency, jitter, download and upload against public servers, with an automatic mode that picks the one with the lowest latency.
  • iPerf3: run a test against a public server, or turn the Pi into a server so another machine can measure against it.
  • WiFi: visible networks with signal quality, channel, security and congestion.
  • Help and About: a guide to the app and, step by step, how to enable NetFlow and SNMP on your router.

Without a router that exports NetFlow, everything else keeps working and the per-device traffic columns simply say n/a. Nothing breaks; it just tells you what it cannot know.

Try it

On Debian, Ubuntu or Raspberry Pi OS there is a package for arm64 and one for amd64. Download the .deb from the releases page and install it:

sudo apt install ./lanwatch_0.4.0_arm64.deb
lanwatch

The package gives the binary the one capability it needs to speak ARP directly, on every install and upgrade, so there is nothing to repeat. If you only want a quick look from a script, lanwatch --once scans, prints the table and exits.

Honest limits

I would rather tell you than let you find out. Operating-system detection is an informed guess, not a fingerprint. Modern phones use random MAC addresses that have no vendor. NetFlow rates are 60-second averages, not instantaneous. And public speed-test servers rate-limit heavy users, so if one says no, pick another.

Standing on good shoulders

lanwatch is written in Rust and draws its interface with ratatui. Vendor names come from the public registry of the IEEE, the speed tests use LibreSpeed and Cloudflare, and the iPerf3 tab drives the iperf3 program. Thank you to everyone behind them.

The code is on GitHub under the GPL-3.0 license. If you also keep a Pi watching your connection, you may like internet-check, which does that job over Telegram.