One of the best ways to ensure the resilience of your home network is to set up a service to monitor its traffic. After all, you can't fix what you don't know is an issue, and gathering data will show you what needs to be fixed. Monitoring is also important for network security, as better monitoring systems can detect intrusions, DDoS attacks, or other potential issues as they occur.
However, many network monitoring programs don't require expensive hardware because they're designed to be lightweight. All you need is a Raspberry Pi, an SD card to install the operating system, and a little bit of time to set everything up. For this tutorial, we'll use the popular open-source program Ntop, but there are tons of other network monitor packages out there that will run just as well on the tiny SBC.
8 reasons a Raspberry Pi is perfect for network filtering
If you want to boost your network security at home or in the office, the Raspberry Pi is a capable choice to use for that purpose.
What you'll need to start
Pick up your SBC and get to work monitoring your home network
To get started monitoring your network with a Raspberry Pi, you only need a few things. Along with the SBC and a memory card to install the OS, you'll also need another computer to copy things onto the SD card and a mouse, keyboard, and monitor if you're going to do all the setup on the Raspberry Pi. If you're comfortable using SSH, you can connect to the Raspberry Pi and set everything up as a headless system.
Other than those peripherals, you'll also want:
- Raspberry Pi with at least 2GB of RAM that has the Raspberry Pi operating system installed
- Ethernet cable
- A suitable SD card with 16GB of space
- Access to the terminal
- Sudo privileges
-
Raspberry Pi 5
- CPU
- Arm Cortex-A76 (quad-core, 2.4GHz)
- Memory
- Up to 8GB LPDDR4X SDRAM
- Operating System
- Raspberry Pi OS (official)
- Ports
- 2× USB 3.0, 2× USB 2.0, Ethernet, 2x micro HDMI, 2× 4-lane MIPI transceivers, PCIe Gen 2.0 interface, USB-C, 40-pin GPIO header
- GPU
- VideoCore VII
- Starting Price
- $60
-
SanDisk 256GB Extreme microSDXC UHS-I Memory Card
This guide assumes you already have the Raspberry Pi OS installed on your SBC. If you're starting with a brand-new Pi, follow the guide below to set up a headless Pi first, then come back.
How to set up a headless Raspberry Pi
There's no need to buy a separate keyboard, mouse, and display for your Raspberry Pi when you can access the SBC from your PC
How to set up network monitoring on the Raspberry Pi
We're going to use the open-source Ntop, which is good for tracking usage, network performance, health, and more
While setting up network monitoring sounds complex, it's actually pretty straightforward. We're going to use Ntop, because it's free, open-source, and powerful enough to track bandwidth usage, monitor the overall health and performance of your network, and identify any bottlenecks that might need adjustment.
Before we start, you'll need to be either on the Raspberry Pi desktop with a Terminal window open or SSH'ed into the Terminal.
-
In the Terminal window, we're first going to download the Ntop deb package from the official website:
sudo wget http://packages.ntop.org/RaspberryPI/apt-ntop.deb
-
To install the package, enter the following:
sudo apt install ./apt-ntop. deb
-
Update the repository one more time before continuing by typing this into the Terminal and pressing Enter:
sudo apt update
-
Now we install additional packages to support Ntop:
sudo apt install ntopng nprobe n2n
-
Now we check that the Ntopng service has started successfully:
systemctl status ntopng.service
-
And we finally check the ports that Ntopng is using:
ss -tunelp | grep ntop
Now that Ntopng is working, it's time to see what we can do in the dashboard.
3 ways to monitor your home’s energy usage with a Raspberry Pi
Some Pi-sized projects to help you keep tabs on your power consumption
Entering the Ntopng web dashboard for further setup
To access the dashboard for configuring Ntopng, take the server IP from the last step and open your web browser. Go to HTTP://ServerIP:3000, and you'll see the login splash screen. The default username and password are both admin, so enter those, then change the password when asked.
There are a ton of things you can monitor from the dashboard, and I fully recommend you check out Ntop's YouTube channel and its extensive documentation pages for diving into the nitty-gritty of what you want to monitor.
Turn your Raspberry Pi into an intrusion detection system with Pi.Alert
Repurpose your Raspberry Pi into a watchdog that can warn you the moment it detects unauthorized devices in your network
The Raspberry Pi is a low-cost alternative to more expensive network devices for monitoring your home network
To get started with monitoring your home network, all you need is a Raspberry Pi and a little time. It's a fantastic little project, and gets you intimately acquainted with how things move around your network once you've been monitoring for some time. Plus, it delays the need for upgrading to expensive prosumer devices like hardware firewalls and managed switches, both of which can do similar monitoring.
