[Solved] MT7530 DSA Port-mirroring

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

https://patchwork.ozlabs.org/project/netdev/patch/20200306123535.7540-1-dqfext@gmail.com/

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.
https://code.google.com/archive/p/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?
https://svanheule.net/switches/testing/mirroring

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

#!/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

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