Monitoring bandwidth used per user. (Because metered internet.)

Hello LEDE users,

I was told that with Lede (or OpenWRT) can help me with my goal.

First, some background:
Three people will share one internet service. Their internet service is not unlimited. It is metered and pricey.
Amy will have just one laptop.
Britney will have a laptop and smartphone.
Courtney will have a Linux Mint desktop, a Linux Mint laptop, an Android tablet and an Android phone.

Most likely, all will be connecting via WiFi (as opposed to ethernet cable).

What is needed to see how much each person has used per month (i.e., billing cycle)?

Ideally, each person has her own login username and password.
Ideally, each person can check her own usage for the month by going to some IP address to see their current usage. (The admin would have access to everyone’s bandwidth/network info.)

No one will game, netflix, torrent.

I've just bought a router that can do Lede 17.01.0: a Western Digital My Net N750 router.

https://lede-project.org/toh/hwdata/westerndigital/westerndigital_mynetn750
https://wiki.openwrt.org/toh/wd/n750

Mon Aug 21 15:15:07 PDT 2017 update: remove section about capping usage

1 Like

I don't have a solution/set of packages to recommend, but one tack would be to install a netflow package on your router, and let that send the data to a netflow collector. This could summarize the traffic for a month/billing period.

In OpenWrt CC, I used the fprobe package (a netflow exporter) on the router, and a trial version of a commercial netflow collector to receive the netflow info and display it. fprobe seems not to have survived the jump to LEDE.

I have also seen a package - ipt-netflow - that is purported to work with LEDE, but I have not verified it. Read more at: https://github.com/alex-eri/ipt-netflow/blob/openwrt-makefile/openwrt/Readme.md

1 Like

Hi, @richb-hanover

Thanks s for your reply. :grinning:

I'm still waiting for the N750 to make its way to my hands.

When you say "summary" does it give me the per-user breakdown I stipulate?

I'm not sure if it's the best solution, but what came to my mind -- separate WLANs/WiFi for each user and then you can probably use collectd/luci-app-statistics to get an idea about the traffic in each WLAN. If there's no inner-network traffic (like NAS), WLAN traffic should be more or less representative of WAN traffic consumed by each user.

2 Likes

hmmm... i'd rather not spend more on hardware. :blush:




That I can think of right now

1 Like

You know you can have more than one WLAN on most LEDE devices, right?

1 Like

stangri, No, i didn't know that :relieved: So on my one and only N750 router, I can have more than one WLAN at the same time? Wowwee!

Thank you, @diizzy .

At first, when I saw your reply, I thought that my ad-blocker wasn't working well. Then I realize it was a helpful post.

I'll look into the 3 packages you listed. Please let me know if you have any other ideas.

:relaxed:

When you say "summary" does it give me the per-user breakdown I stipulate?

It could give you a per-IP breakdown, and you would then need to assemble that
into per-user data (fixed DHCP allocations are your friend here)

David Lang

1 Like

Take a look at YAMon (http://usage-monitoring.com)...I just installed it on a Linksys E4200 running LEDE last week.
YAMon will definitively give you per device monitoring that can be rolled-up by owner.

Out of the box, you will not get

  1. separate user logins
  2. ability to cap usage.on a per device basis

Full disclosure... I'm the guy behind the development, care, nurturing and feeding of YAMon. I could look at a way to provide per user logins but that will take some effort. Capping usage is going to be problematic (I fear it'll become a whack-a-mole chase as your users will quickly learn how to spoof IP and/or MAC addresses)

Please PM me if you have additional questions

1 Like

al_c,

thanks for your post on YAMon. how do I pm you? lol.

I fear it'll become a whack-a-mole chase as your users will quickly learn how to spoof IP and/or MAC addresses.
I will be the admin. So Amy won't see Britney or Courtney's IP/MAC addresses, right? And Britney won't see Amy or Courtney's IP/MAC addresses, right? In my mind, a device won't be able to go online until it's linked to a user.

For us, capping usage is maybe less important as making sure each byte is linked to some user.

If you want your users to have separate passwords (and you have very limited number of users), it would make sense to create separate wlans for them and track per wlan.

Mmh, that way, if I understand correctly, vnstat could be used for the logging and accumulating, as in this approach there will be one interface per user, no? As far as I can tell vnstat is quite cheap.

Yeah, that should solve the problem of different mac addresses per user, etc. I concur on vnstat -- it's lightweight and will probably be easiest to configure with its luci app.

[quote="moeller0, post:14, topic:2167"]
vnstat is quite cheap.[/quote]
moeller0, thanks for your reply. I went to http://humdi.net/vnstat/ and it appears that vnstat is free. When you say cheap, what do you mean?

Yes. And, just to be clear, I don't expect the users to enter passwords every time they want to surf. The password will only have to be entered in 2 occasions:

  1. For the initial linking up of the device to the user
  2. For the user to check his bandwidth usage for the month (or even for the day)

[quote="stangri, post:13, topic:2167"]
If [...] you have very limited number of users[/quote]
Around 4 users only. Maybe even just 2.

Hi greenlaser,

oh, sorry, I meant vnstat is not very resource hungry, as in computationally cheap and will not put much stress on your router. To install it I would recommend to install luci-app-vnstat with th GUI (or "opkg update ; opkg install luci-app-vnstat" via a ssh login into the router). There is an openwrt wiki/howto page about how to set up vnstat and also how to make persistent copies of the logged values, otherwise your users only need to tenprarily unplug the router to wipe all logged data...

vnstats

I think this is what you are looking for https://github.com/VREMSoftwareDevelopment/bwmon

A few more bmon for openwrt/lede https://wiki.openwrt.org/doc/howto/bwmon

1 Like

Issue is that vnstat doesn't track per user/ip/mac afaik, only interface you can work around it but either way accounting cpu load isn't going to be an issue irregardless of what you use.

1 Like

But this is why the proposal was to create one SSID per user and only give that user the password. Then vnstat would work effortlessly, plus this solution also covers the per user log-in/password requirement.

1 Like