Kiougar / luci-wrtbwmon

Bandwidth tracker for OpenWRT that uses wrtbwmon
https://github.com/pyrovski/wrtbwmon
MIT License
327 stars 56 forks source link

Bridged AP #20

Open joshuabrand1 opened 6 years ago

joshuabrand1 commented 6 years ago

I cannot get this to work on a Bridged AP (https://wiki.openwrt.org/doc/recipes/bridgedap)

No traffic seems to get recorded on the usage page. Seems to install and display okay though.

Kiougar commented 6 years ago

I haven't used that Bridged AP configuration but let's try to figure this out.

Can you please run this command wrtbwmon update /tmp/usage.db and paste the contents of the file /tmp/usage.db here?

joshuabrand1 commented 6 years ago

Okay so this morning I've checked and its now half working (??)

Upload is working fine but no download figures are coming through....

#mac,ip,iface,in,out,total,first_date,last_date a4:77:33:cb:d5:b8,192.168.178.102,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 30:e3:7a:02:23:df,192.168.178.200,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 ac:1f:74:45:e9:ce,192.168.178.108,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 a4:5e:60:7d:8b:24,192.168.178.214,br-lan,0,194485,194485,04-03-2018_10:50:50,04-03-2018_10:56:10 30:e3:7a:02:23:df,192.168.178.119,br-lan,0,118501,118501,04-03-2018_10:50:50,04-03-2018_10:57:18 2c:33:7a:09:5b:b9,192.168.178.143,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 00:15:c0:39:24:83,192.168.178.243,br-lan,0,1094956,1094956,04-03-2018_10:50:50,04-03-2018_10:57:18 34:81:c4:b7:45:95,192.168.178.1,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 c0:38:96:4d:be:8b,192.168.178.155,br-lan,0,108281,108281,04-03-2018_10:50:50,04-03-2018_10:57:18 3c:cd:93:83:a4:94,192.168.178.228,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 60:f4:45:9d:30:67,192.168.178.169,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 f0:99:bf:7c:02:c7,192.168.178.179,br-lan,0,185431,185431,04-03-2018_10:50:50,04-03-2018_10:56:28 60:f4:45:9d:30:67,192.168.178.199,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50 00:15:c0:39:24:83,192.168.178.40,br-lan,0,0,0,04-03-2018_10:50:50,04-03-2018_10:50:50

On another note, there seems to be duplicate devices in there?

Kiougar commented 6 years ago

This seams to be related to this issue pyrovski/wrtbwmon#23

As for the duplication, wrtbwmon adds a new database row for each different IP it finds, that's why multiple MAC addresses exist.

joshuabrand1 commented 6 years ago

Oh yes, didn't see that one! Seems to be the exact same issue as I tried https://github.com/wtc0der/wtBRMon/ too and got the same results - no download stats. No fix found as of yet though?

Okay, thank you for the clarification.

Kiougar commented 6 years ago

It seems there isn't one yet. Unfortunately I haven't tried that kind of setup so I can't contribute to fixing it :(

grothkopp commented 6 years ago

Ok I think I found the solution (at least for me on barrier breaker): echo "1" > /proc/sys/net/bridge/bridge-nf-call-iptables see this for an explanation: https://serverfault.com/questions/162366/iptables-bridge-and-forward-chain

joshuabrand1 commented 6 years ago

Thank you for this, I can now see the download of my wireless devices. However, it is still not recording download traffic for anything hard wired into the router - any ideas?

grothkopp commented 6 years ago

You can check the LAN and WAN zones, maybe the physical ports are not in LAN? But be careful not to lock yourself out of the router (if the router itself doesn't belong to a zone). If that doesn't help, you can try to redirect the input and output chains to the forward chain (at your own risk). Something like iptables -A RRDIPT_INPUT -t mangle -j RRDIPT_FORWARD

joshuabrand1 commented 6 years ago

By 'Check the LAN and WAN Zones' do you mean the interfaces or Firewall zones? - Sorry, really new to all of this.

grothkopp commented 6 years ago

I meant the luci web interface on openwrt (its just another way of changing the firewall and routing rules). In luci, go to network-> interfaces, click on lan, then "physical settings" and check whats in there. Thats how it works for me on openwrt barrier breaker, I don't know if it's the same for you.

joshuabrand1 commented 6 years ago

Okay yes i understand, this is what I have in my physical settings -

luci