Skip to content

Interface Statistics and Traffic Monitoring

Interface Statistics and Traffic Monitoring

Section titled “Interface Statistics and Traffic Monitoring”

RouterOS provides several complementary tools for observing traffic volume and active sessions:

ToolWhat it showsScope
monitor-trafficLive bits/packets per secondPer interface
print statsCumulative byte/packet/error countersPer interface
/ip/accountingByte and packet totals per source/destination IP pairPer router
/ip/firewall/connectionActive connection tablePer router
/ip/traffic-flowNetFlow/IPFIX export to external collectorsPer router

/interface monitor-traffic displays real-time throughput rates, refreshed every second.

/interface monitor-traffic ether1

Monitor multiple interfaces simultaneously:

/interface monitor-traffic ether1,ether2,sfp-sfpplus1

Press Ctrl+C to stop.

ColumnDescription
rx-bits-per-secondIncoming data rate (bits/s)
tx-bits-per-secondOutgoing data rate (bits/s)
rx-packets-per-secondIncoming packet rate
tx-packets-per-secondOutgoing packet rate

Example output:

name rx-bits-per-second tx-bits-per-second rx-packets-per-second tx-packets-per-second
ether1 92.4Mbps 45.1Mbps 8213 4107

/interface print stats returns accumulated counters since the router started (or since the last counter reset). Unlike monitor-traffic, this command shows totals rather than rates.

/interface print stats

Scope to specific interfaces:

/interface print stats where name=ether1

For Ethernet-specific counters:

/interface ethernet print stats
CounterDescription
rx-byteTotal bytes received
tx-byteTotal bytes transmitted
rx-packetTotal packets received
tx-packetTotal packets transmitted
rx-errorReceive errors (CRC, frame, etc.)
tx-errorTransmit errors
rx-dropReceived packets dropped (buffer full)
tx-dropTransmit packets dropped

Reset all interface counters to zero:

/interface reset-counters

Reset a single interface:

/interface reset-counters ether1

IP accounting tracks byte and packet totals grouped by source/destination IP pair. It provides per-host visibility into who is sending or receiving the most traffic.

/ip/accounting set enabled=yes

To also count traffic originating from or destined to the router itself:

/ip/accounting set enabled=yes account-local-traffic=yes

Limit the number of tracked IP pairs (affects memory use):

/ip/accounting set enabled=yes threshold=2560
/ip/accounting print

Example output:

SRC-ADDRESS DST-ADDRESS PACKETS BYTES
192.168.88.10 1.1.1.1 4217 5324288
192.168.88.20 8.8.8.8 822 105216

The accounting table accumulates continuously. Take a snapshot to freeze a point-in-time view for processing:

/ip/accounting snapshot save
/ip/accounting snapshot print

Expose accounting data over HTTP for polling by external systems:

/ip/accounting web-access set accessible-via-web=yes address=10.0.0.0/24

Access the data at http://<router-ip>/accounting/ip.cgi.

The connection tracking table records all active sessions passing through the router. It is used by the firewall for stateful filtering and provides visibility into live connections.

/ip/firewall/connection print

Filter by destination address:

/ip/firewall/connection print where dst-address~"10.0.0.1"
FieldDescription
protocolTransport protocol (tcp, udp, icmp)
src-addressSource IP and port
dst-addressDestination IP and port
connection-stateCurrent state (established, time-wait, close-wait, etc.)
timeoutTime remaining before the entry expires
orig-packetsPackets in the original direction
repl-packetsPackets in the reply direction
StateMeaning
newSession just started; not yet replied
establishedBidirectional traffic seen
relatedRelated to an existing connection (e.g. FTP data)
invalidPacket does not match any known session
untrackedBypassed tracking (FastTrack or raw table rule)

FastTrack and hardware offloading bypass connection tracking for matched flows. Traffic accelerated by FastTrack or hardware switching will not appear in the connection table, and firewall rules that match on connection state will not apply to it.

Force a connection to be re-established (useful after policy changes):

/ip/firewall/connection remove [find dst-address~"10.0.0.1"]

For long-term flow analysis and external reporting, RouterOS can export flow records to a NetFlow/IPFIX collector such as ntopng, Grafana/Loki, or PRTG.

/ip/traffic-flow set enabled=yes interfaces=all \
active-flow-timeout=30m inactive-flow-timeout=15s \
cache-entries=4k

Add a collector target:

/ip/traffic-flow/target add dst-address=192.0.2.10 port=2055 version=9
PropertyDescription
enabledEnable flow export
interfacesInterfaces to capture (all or comma-separated list)
active-flow-timeoutExport active flows after this interval
inactive-flow-timeoutExport idle flows after this interval
cache-entriesFlow cache size (larger = more memory, fewer premature exports)
versionExport format: 1, 5, 9 (NetFlow), or 10 (IPFIX)
/interface monitor-traffic [interface find]

Monitors all interfaces at once; identify which is hitting its capacity limit.

/ip/accounting set enabled=yes
# ... wait for traffic to accumulate ...
/ip/accounting snapshot save
/ip/accounting snapshot print

Sort output to find the top talkers.

/interface print stats where name=ether1

Rapidly increasing rx-error or rx-drop values indicate a physical layer problem (bad cable, duplex mismatch, SFP issue).

Verify a Connection Cleared After Firewall Change

Section titled “Verify a Connection Cleared After Firewall Change”

After modifying firewall rules, confirm old sessions are gone:

/ip/firewall/connection print where dst-address~"10.0.0.5"

If entries remain, remove them to force re-evaluation under the new rules.

  • Torch - Real-time per-flow traffic inspection
  • Bandwidth Test - Throughput measurement between MikroTik devices
  • Traffic Flow - NetFlow/IPFIX export configuration
  • Firewall - Stateful packet filtering using connection tracking
  • Graphing - Built-in interface traffic graphs