
Monitor your local network with Raspberry Pi - rigaspapas
http://rigaspapas.com/blog/monitor-your-local-network-with-raspberry-pi/
======
dogma1138
Meh, this is crap.

1) You need a router that supports DHCP relay, which most home routers do not
natively support.

2) It won't show you clients that are connected to the Wifi which is probably
the majority of clients in most home networks.

3) It doesn't give you the ability to monitor anything beyond the DHCP lease
table which all routers show.

So besides wasting 50$, losing a port on your router and having another thing
that might break your network down you aren't getting anything.

~~~
droopybuns
I think you are being unnecessarily harsh.

There is a need for tools that people can use for monitoring the activity on
their home networks. All of these IoT devices are going to create problems
that need troubleshooting. Yes, the ideas outlined are simple, but this can
evolve over time to solve a problem that is going to be increasingly important

~~~
dogma1138
The problem it's not a tool that actually monitor activity on the network at
all, you are better off getting a router with 3rd party firmware support or a
slightly better home router which many even come with SNMP these days.

------
trm42
Somehow I expected this talk about real network monitoring like using Ntop,
Nagios, arpwatch etc. Just creating another dhcpd for the lan/wifi feels
cumbersome just to get dhcp leases.

So how about using RPI as a network bridge between the router and the client
hosts and then using Ntop, arpwatch etc. Then you can actually monitor the
traffic in detail.

~~~
forcer
I read some sources that Pi is not that fast to route traffic through it.

However, maybe at least setting up DNS server on Pi would get some "live"
stats without sacrificing performance ?

~~~
trm42
I would expect that RPI could route normal home lan traffic well enough unless
there's some big IO limitations regarding ethernet+usb ethernet. Linux has
been used for routing with a lot lower spec HW than RPI or RPI2.

~~~
haswell
I ran a Pi router for awhile, and can confirm that the USB ports are the
bottleneck. It was great when I was using it to split traffic between two
crappy 3-6Mbit links, but once I finally got hooked up with a decent
connection (90Mbit), I quickly hit a 30Mbit-ish ceiling.

~~~
trm42
Sounds plausible. Thanks for the info :)

------
rufugee
I guess it's interesting as an exercise, but openwrt gives you this and so
much more on $30 routers. After years of experimenting with different router
firmwares, I can't recommend openwrt enough. It's simply phenomenal.

~~~
pandog
[http://www.dx.com/p/346531](http://www.dx.com/p/346531) seems to be a rather
nifty $25 openwrt router

~~~
rufugee
I have three OpenWRT devices: a Linksys wrt1900ac (v2), and two TP-Link
WDR3600s. Considering that you can pick up the WDR3600 on Amazon for roughly
$50, it's a steal. I have multiple vlans configured across all three (which
OpenWRT makes very easy to do) and certain SSIDs isolated to certain vlans,
even on the same radio. I just set up WDS last night between the two WDR3600s,
and it was such a simple process. I have the utmost respect for OpenWRT and
what it lets you accomplish. Plus, it's far more professionally-run project
than other firmwares like Tomato. If you haven't played with OpenWRT yet, I
wholeheartedly suggest you do.

------
VLM
"netmask 255.255.255.0"

"We chose to use the range 192.168.1.0/8 as our local network"

Minor typo, although it doesn't really matter in the big picture.

I like how it was written. In line commentary, like a tourist guide or a very
informal runbook.

As a meta comment about the project goals it seems almost like a parody of
taking something like logging into the CLI and running "arp" and turning it
into the largest and most complicated system imaginable, I'm trying to figure
out how to make it more complicated, maybe running it on https instead with a
valid cert, or perhaps doing it all in Intercal or cobol instead of node.js.

------
hultner
You could set up an promiscuous WiFi card and monitor all active WiFi-
sessions, the radio signals are still there, readable even if the actual
connection/data is encrypted.

We did this at my university to monitor who's in our social activity
facilities at any given time (opt-in).

~~~
dmos62
That's what I thought this was going to be. A relay DHCP server seems
cumbersome.

------
nurettin
>> Simply because WiFi is managed by the router and most of the routers out
there don't provide you with such information or statistics.

I love Pi, and I have my own raspberry pi router project with 3d printed box
and everything. But why spend money and an extra ethernet port for information
that you can scrape off of your router's http page with something simple like
a web testing tool?

~~~
rigaspapas
Just to save time and practice skills. It's faster, since it doesn't require
passwords, and more responsive and beautiful, since it uses bootstrap.

------
linker3000
It's a bit of fun, but you could probably do better with a Mikrotik board (eg:
[http://routerboard.com/RB922UAGS-5HPacD](http://routerboard.com/RB922UAGS-5HPacD)
list price $79), a low-end microATX board with a few network adaptors - or as
others have suggested, a wireless router with something like OpenWrt etc.

------
alistairjcbrown
This is nice way of getting the live device data out from the router - I've
made a few scripts in the past for logging into the router web interface and
scraping connected device data as a "Who's in the house" display.

Pulling the DHCP functionality out into something more accessible is a great
idea!

~~~
baldfat
Not for me on FIOS (I have one year left on my contract UGH! but I was told NO
Contract sign here I'm a Noob)

I use to have my own DNS on my server for these purposes and could get a text
or email whenever my kids started pulling data on wifi (Teenagers who "can't
sleep" than I pulled this trick and they were sleeping)

Fios TV must have the DNS going through their crappy router.

------
spacecowboy_lon
Would not using openwrt be a better solution I think that reports by client.
And I am sure that Cisco Airnet and Ruckus kit does this.

And there are hacker distros for the PI designed for use as an ICE device -
ideally you need to have a ethernet tap other wise you need two ports to
monitor ethernet.

~~~
paddi91
Do you know if this is somehow possible using OpenWRT? Would be great to have
a life updating view of all connected Wifi devices including bandwith usage /
limit and so on.

~~~
atmosx
Of course. You can even send the dhcp logs remotely, to a syllogism server.
OpenWRT can do a lot more than that...

------
necrodome
"By using only your current WiFi router that's surely impossible."

umm, what? I haven't seen a router for a long time that doesn't have that
feature.

~~~
alistairjcbrown
Right - but if you're bolting on a Raspberry Pi, there's no way for it to know
"live usage of WiFi" \- only the router knows that

~~~
ShinyCyril
I think the point being, why even use the Raspberry Pi in the first place
given that most routers (even a lot of consumer ones) maintain a list of
currently connected users.

~~~
alistairjcbrown
Do many routers make that data easily accessible for automated use? From my
experience, it requires work to get at that data.

~~~
ShinyCyril
It depends on your definition of easily accessible. For example, on my TP-Link
W8961N you can use Python's Requests library, Beautiful Soup and HTTP Basic
Auth to retrieve and parse the client list.

------
johnchristopher
It'd be more interesting to dive into that nodejs snippet. The work to get the
final result (a list of connected devices) has already been done and
implemented in your home router.

And you swap a real router for a bandwidth constrained raspberry to get that
list.

------
OJFord
Curious - if you click 'Home' you (I) get chucked onto port 2368; the page is
also served on 80, but not others (at random) - why is that? Funky load-
balancing?

~~~
rigaspapas
Just some rewrite rules to prettify the URL. It's a ghost blog, running in
port 2368.

------
drzaiusapelord
You could probably install something like pfsense or untangle and get a whole
heck of a lot more tools. Or even dd-wrt. I'm assuming the drivers exist for
this.

------
JustSomeNobody
Stopped reading after calling OnHub a game-changer.

------
thebakeshow
Just a nminor nitpick, it says you're using 192.168.1.0/8 but your netmask is
255.255.255.0 which would be /24 in CIDR

------
jo-m
this solution monitors the wifi by sniffing on it (RPi and cheap WiFi dongle):

[https://people.ee.ethz.ch/~muejonat/wifimon/](https://people.ee.ethz.ch/~muejonat/wifimon/)

------
ck2
Or use the $15 orange pi clone.

