bandwidthd and vlans

  • I am switching away from the "total traffic" package after I discovered its feeding me bogus data.

    I also decided I want to tally the usage across devices within my network so monitoring the LAN side.

    The issue is I have 2 VLAN's and I can only choose one of them for bandwidthd.

    The solution seems simple but noone has implemented it, but am I right in thinking I simply need to run multiple instances of bandwidthd, so one for each vlan and problem solved?

  • Pardon the digression but why did you feel the "total traffic" package (vnstat) is feeding you incorrect data? I am curious as I also want an accurate, reliable measure and assumed vnstat is pretty good.

  • There is 2 issues.

    The data for the interfaces is 100% mirror of each other so e.g.

    Wan 50gig inbound
    Lan 50gig inbound
    VPN (sitting idle) 50 gig inbound

    and so on, obviously thats wrong.

    The second issue is the figures are greatly inflated as if some kind of multiplier is been applied to the values.

    Also the figures dont match up from figures displayed by counters from the OS. I compared to counters from PF, and kernel drivers.

    I now also have bandwidthd as a source, and that whilst I dont believe is 100% accurate looks at least close to reality and is nowhere near the figures from vnstat.

    I dont know what vnstat is doing on my pfsense unit but its not working as it should.

  • One thing I noticed is that if vnstat does not have a DB for an interface it will appear to show incorrect statistics. See if each interface has a DB here:


    If one is missing create it:

    vnstat --create --iface em1

    See if that is the case...

  • Well you might be on to the reason.

    It looks like these databases have not been updated as over time I have made configuration changes to the unit.

    I removed old long disabled interfaces.

    I added new ones.

    I will report back if this fixes the vnstat problem :)


    After a few hours I will say it looks good :)

    All interfaces have their own stats now and they look realistic, thanks for the fix.

    I will see if I can make a script to send to the author of the package to make this pickup interface configuration changes as it looks like it stays in the configuration from when the package gets installed on first run.

    Also works with VLAN's.

    I will keep the bandwidthd configuration in place as I have that LAN side so its providing me stats per LAN side device which is nice. But again I am looking into making a patch for bandwidth so it can have multiple instances which would allow it to support things like VLANs.

  • Good to hear - I found this out also because I fiddled with my interfaces long ago and had the same issues, not a very intuitive fix but at least it works.

Log in to reply