Where to read wan statistics?

This guide says that amount of received and sent data on br-lan interface is contained in files
/sys/devices/virtual/net/br-lan/statistics/rx_bytes /sys/devices/virtual/net/br-lan/statistics/tx_bytes.
It also says to:

change br-lan below with the name of your modem's interface if you want to look only at bandwith used for Internet.

But /sys/devices/virtual/net/wan/statistics/rx_bytes /sys/devices/virtual/net/wan/statistics/tx_bytes don't exist because /sys/devices/virtual/net/wan doesn't exist.

Where can I find statistics about wan interface?


Maybe use ifstatus wan | grep -e \"device\": to get the true linux device that "hides" behing the "wan" symbolic name and then use that instead of wan in the path, like:

root@turris:~# cat /sys/devices/virtual/net/wan/statistics/rx_bytes 
cat: can't open '/sys/devices/virtual/net/wan/statistics/rx_bytes': No such file or directory
root@turris:~# ifstatus wan | grep -e \"device\":
        "device": "eth2.7",
root@turris:~# cat /sys/devices/virtual/net/eth2.7/statistics/rx_bytes 

Eventually found at
cat /sys/devices/platform/1e100000.ethernet/mdio_bus/mdio-bus/mdio-bus:1f/net/lan1/statistics/rx_bytes

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.