Use port mirroring on a WR switch (WRS)
1. Introduction
Although port mirroring is supported by WRSs a corresponding command option is not documented in the user manual.
Generally, port mirroring is used on a network switch to send a copy of network packets seen on one switch port to another switch port for monitoring of network traffic. It helps network engineers or administrators to analyse and debug data or diagnose errors.
2. Port mirroring in WRS
A WRS firmware provides an CLI tool,
rtu_stat, which features options for port mirroring. It can mirror the inbound and outbound traffic separately only on a single port.
The capabilities of port mirroring options regarding source/destinataion ports and traffic type are listed in Table 1 below.
Note: these capabilities have been tested in an access-layer, VLAN-aware WRS (v6.0.1), which is configured according to the GSI
Timing Network v2 (TN2) setup.
Table 1. Port mirroring capabilities by rtu_stat
Ports (src -> dst) |
Traffic |
Applicable |
single src/dst (wri3 -> wri13) |
inbound |
yes |
single src/dst (wri9 -> wri13) |
outbound |
yes |
single src/dst (wri3 -> wri13 AND wri3 -> wri13) |
in & out |
yes |
2 sources, single dst (wri9 -> wri13 AND wri3 -> wri13) |
in & out |
yes |
single src, multi dst (wri3 -> wri13 AND wri3 -> wri14) |
in, out, both |
no |
multi src, multi dst (wri3 -> wri13 AND wri4 -> wri14) |
in, out, both |
no |
The usage syntax can be get by invoking
rtu_stat -h:
list: List the routing table including
port mirroring settings (same as empty command)
mirror ingress <src_port> <dst_port>: Enable mirroring of ingress traffic
from src_port to dst_port
mirror egress <src_port> <dst_port>: Enable mirroring of egress traffic
from src_port to dst_port
mirror off: Turn off port mirroring
...
where:
<port> port number on which RTU rule is registered; it is a port
number from 1 to 18, or the CPU (19)
3. Examples
3.1. Mirroring inbound traffic only
Enable mirroring inbound traffic on
wri3 to
wri13:
rtu_stat mirror ingress 3 13
The command takes effect immediatelly showing the final status like:
...
RTU Port Mirroring Config Dump:
Status: Enabled
Ingress: port 3 -> port 13
3.2. Mirroring inbound and outbound traffic (same source port)
Enable mirroring both inbound and outbound traffic on
wri3 to
wri13:
rtu_stat mirror ingress 3 13
rtu_stat mirror egress 3 13
In this case the final status should be:
...
RTU Port Mirroring Config Dump:
Status: Enabled
Ingress: port 3 -> port 13
Egress: port 3 -> port 13
3.3. Mirroring inbound and outbound traffic (different source ports)
Enable mirroring inbound traffic on
wri3 to
wri13 and outbound traffic on
wri9 to
wri13:
rtu_stat mirror ingress 3 13
rtu_stat mirror egress 9 13
The result should look like:
...
RTU Port Mirroring Config Dump:
Status: Enabled
Ingress: port 3 -> port 13
Egress: port 9 -> port 13
--
EnkhboldOchirsuren - 15 Sep 2021