Comcast is enforcing a new data cap on some customers reportedly starting as early as next month, January 2021. I'm both a data scientist and a tenant under someone else's internet plan; I know I've gone over 1 TB in a month before, so I'm trying to figure out how to monitor my data usage.

Previous similar questions on Unix SE and AskUbuntu talk about how to turn on the metered connection setting in Network Manager or just about general tools to monitor traffic in realtime.

Is there a way to record monthly network usage in Linux as smartphones do for data plans? Ideally, it would be something per an individual connection profile.

1 Answer 1


You are really only concerned with traffic that goes outside of your local network. Most OS-level network statistics are going to be at the interface level, not the destination/source level, and would only reflect that of a single device.

I'd suggest putting a firewall between your personal segment and that of the shared router. The firewall will count the traffic for you, and would only reflect traffic that you actually use.

  • Could you elaborate on "putting a firewall between your personal segment and that of the shared router"? I like the idea, but I'd need more direction on how to do so. I'm imagining I would need separate hardware that my devices are connected to as an additional hop to the router?
    – user233770
    Commented Dec 30, 2020 at 21:52
  • 1
    Yes, there would be an additional piece of hardware. A small computer running pfsense, or maybe an rpi running iptables... there are a zillion options. If you aren't quite that nerdy, you could just go buy another wifi router. You would plug the new router's WAN port into one of the LAN switch ports on the existing shared router, and then plug your devices into the switch ports on your new personal router. This would also allow you to have your own WiFi network, if you also wanted to track the traffic your personal wireless devices use. The how-to details are a bit much for this post.
    – mikem
    Commented Dec 30, 2020 at 22:31

You must log in to answer this question.