Yahoo
Advertisement
Advertisement
Advertisement
Advertisement

How I use my Raspberry Pi to keep an eye on my network traffic (and why)

A Raspberry Pi 4 with an ethernet cable attached in the back.
Nick Lewis / How-To Geek

Your home router can provide basic network monitoring features, but if you need something more advanced, or if you want to integrate output from a network monitor into other services you're self-hosting, you'll need something more. These are a few network monitoring solutions worth trying.

A home network monitor is a multipurpose machine

Initially, I started looking at setting up a network monitor so I could make my smartphone respond to changing conditions on my network.

For example, I have a porch light that I'd like to turn on whenever I get home. A network monitor can be used to detect when I arrive at home since my phone will automatically connect to the Wi-Fi. Combining occupancy detection with Home Assistant allows me to have a porch light that turns on automatically when I get home, but only if it is after a certain time of day.

Advertisement
Advertisement

There are other things that it could be used for too. I've recently been replacing my regular LED bulbs with smart bulbs, and I wanted to be sure that if I left home and forgot to shut off the lights, they'd turn themselves off to save power.

TP-Link BE3600 Wi-Fi travel router sitting on a table in a hotel room.

Justin Duino / How-To Geek

Combining a network monitor—which can detect if my phone is connected at all—with Home Assistant allowed me to create an automation that will turn the lights off if I've been gone for a certain amount of time. As I've experimented with a home monitor more, I quickly realized that the potential goes beyond helpful automations.

It isn't common, but it is sometimes possible that you'll have an unwelcome visitor on your Wi-Fi network . It could be a neighbor that guessed your W-Fi password, or perhaps someone left a snooping device of some kind.

Home routers are perfectly capable of displaying the devices that are attached to your Wi-Fi network, but I don't check that regularly.

A Raspberry Pi is a decent first home network monitor

I started my network monitoring setup with very simple needs, so I ran the entire thing on a Raspberry Pi 4 to start.

Advertisement
Advertisement

For monitoring the connections of a few smart appliances, that was fine. However, when I tried to move more devices over, I quickly ran into a problem: The Pi didn't have the horsepower to keep up with everything.

A Raspberry Pi with its offiical cooler fitted.

Sydney Louw Butler/How-To Geek

Whatever device monitors your network, or part of your network traffic, needs to be able to receive, process, and then retransmit all of it in real time, otherwise you'll introduce latency.

In the future, I'd like to set up more sophisticated monitoring for every device on my network, including all of my self-hosted services that live on my old Windows 10 PC . That is going to require a pretty significant hardware bump.

To keep things energy efficient and tidy, I'm going to buy a small mini PC to use as a dedicated network monitor.

Advertisement
Advertisement

If you're buying something new, I'd recommend staying away from Raspberry Pis. They're a good place to start if you have them on hand, but I think most networks would quickly expose their limitations.

What network monitoring software should you try?

My initial network monitor experiment was little more than a network-based occupancy sensor, so I started with an open-source project by Delvision.

It uses ARP to track which devices are connected and feeds that into a log, which I piped over to Home Assistant.

It is basic, consumes almost no computational power, and I found it to be very reliable. If I opted to set this up again, I'd put it on a Pi Zero 2W, since it is so lightweight.

For intruder detection

If you're just looking to keep an eye out for uninvited guests on your wireless network, then Pi Alert is a good option. It'll warn you any time a new device is connected, or any time that a device that should always be connected—like a smart outlet—suddenly disconnects.

Advertisement
Advertisement

The installation process and web interface are both very straightforward, which makes it extremely easy to use.

For speed monitoring

If you just want something to track your internet speeds, I would recommend Internet Pi.

It keeps a running tab on your internet speed and your average ping, then displays everything in a convenient dashboard.

The output of Internet Pi.

It also comes packaged with a Pi-hole, a network-wide adblocking solution . If you have an air quality monitor, a smart outlet that monitors power, or a Starlink, you can also configure Internet Pi to display data from those devices too.

An all-purpose monitor

However, the network monitor I'm currently building will monitor all incoming and outgoing traffic, which means I'll need something more advanced. In the future, I'd like to be able to record and analyze traffic from every device on my network, including the individual virtual machines and containers I'm self-hosting with Proxmox.

Advertisement
Advertisement

My brief experiment with Ntopng was very positive, but my homelab is a bit too busy for a Pi 4 to keep up with. When my mini PC arrives, it'll be the first network monitoring software I install.


A network monitor can be anything from a simple additional security measure, to a helpful tool for Home Assistant automations, to a robust analytics tool for your homelab. If you're on a small network and don't have many devices, a Raspberry Pi 4 or 5 you have around will be plenty.

However, I wouldn't buy one specifically for that purpose. As I experimented more and more with network monitoring software, I quickly found that the number of things I wanted to try grew beyond what a Pi could handle. If you're a self-hosting enthusiast, you'll probably run into the same problem.

Advertisement
Advertisement
Mobilize your Website
View Site in Mobile | Classic
Share by: