[Solved] MT7530 DSA Port-mirroring

I test now and it's realy work great.
I write mini script for fast using.

Packages install ip-full and tc-full

#!/bin/sh

#creds https://svanheule.net/switches/testing/mirroring

sniffPort=wan
mirrorPort=lan2

#Turn on the mirror port
ip link set up dev ${mirrorPort}

#Add the clsact queue discipline. This qdisc lets us attach the matchall filter
tc qdisc add dev ${sniffPort} clsact

#Mirror all packets inbound on sniffPort (ingress) to mirrorPort. Note the skip_sw flag, meaning this command will not fall back on mirroring via the CPU if the hardware offload fails
tc filter add dev ${sniffPort} ingress matchall skip_sw action mirred egress mirror dev ${mirrorPort}

#Mirror all packets going out of snifPort (egress) to mirrorPort
tc filter add dev ${sniffPort} egress matchall skip_sw action mirred egress mirror dev ${mirrorPort}
5 Likes