[Solved] MT7530 DSA Port-mirroring

I have a Xiaomi r3g v1 that have MT7530.
Now it's migrate for DSA with kernel 5.4.


How to setup simple port mirroring.
I only use for test simple bridge in wan with lan1.
I need port mirroring for lan2.

Does https://openwrt.org/packages/pkgdata/port-mirroring help?

This packages is https://github.com/mmaraya/port-mirroring.
Is the mirroring on cpu port using iptables with tee.
Thanks but is not I need.

I need Port Mirroring on Hardware Switch.
If i enable hardware offloading all packages is send to other port and is not view on cpu port.
I don't how configure on openwrt or linux.

Perhaps like this?

Interesting. I test with this tomorrow and feedback for you.

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

Packages install ip-full and tc-full


#creds https://biot.com/switches/testing/mirroring


#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}

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