Community discussions

MikroTik App
 
reemeek
just joined
Topic Author
Posts: 1
Joined: Sun Feb 09, 2025 5:40 pm

Vnstat. Access to the physical interface or duplicate traffic.

Sun Feb 09, 2025 5:57 pm

Hi, I am trying to install vnstat container https://github.com/vergoh/vnstat-docker
I was able to get it to work. I can get into the shell and manually run the vnstat program, display the website. I've run into a problem that I can't handle. Ultimately, I wanted to have statistics on internet usage, since I have a certain amount of internet usage per month. I need to access the ether1 interface or duplicate traffic from ether1 to veth1. Do you have any ideas? Below are the commands ;)
/interface/veth/add name=veth1 address=172.17.0.2/24 gateway=172.17.0.1
/interface/bridge/add name=containers
/ip/address/add address=172.17.0.1/24 interface=containers
/interface/bridge/port add bridge=containers interface=veth1
/ip/firewall/nat/add chain=srcnat action=masquerade src-address=172.17.0.0/24


/ip firewall nat
add chain=dstnat action=dst-nat protocol=tcp to-addresses=172.17.0.2 to-ports=8685 dst-address=192.168.88.1 dst-port=8685
/ip dns set servers=172.17.0.2


/container/envs
add key=HTTP_PORT name=vnstat_envs value=8685
add key=LARGE_FONTS name=vnstat_envs value=1
add key=DARK_MODE name=vnstat_envs value=2
add key=TZ name vnstat_envs value Europa/Warsaw


/container/mounts
add dst=/var/lib/vnstat name=vnstat_data src=/usb1/vnstat_data


/container/add file=vnstat.tar interface=veth1 logging=yes start-on-boot=yes root-dir=usb1/vnstat_data mounts=vnstat_data envlist=vnstat_envs