How to Port Mirroring on openWRT

- activate Port mirroring in network file or on luci backend under switch menu:

2. My Setup script:
#!/bin/bash
#
# open with: set_mirroring.sh [MONITORPORT] [PORTTOMONITOR]
#
# ----------------------
# Network config file:
# ----------------------
#
# config switch
# option name 'switch0'
# option reset '1'
# option enable_vlan '1'
#
# config switch_port
# option port '2'
# option enable_mirror_rx '1'
# option enable_mirror_tx '1'
#
clear
echo "--------------------------------------"
echo "--- SET MIRRORING (c) 2020 suuhmer ---"
echo "--------------------------------------"
echo
echo "LAN4 = 1 LAN3 = 2 LAN2 = 3 LAN1 = 4 / WAN = 0"
echo
swconfig dev switch0 set mirror_monitor_port $1
echo "set ports to monitoring RX/TX... "
sleep 2
swconfig dev switch0 port $2 set enable_mirror_rx 1
swconfig dev switch0 port $2 set enable_mirror_tx 1
echo
swconfig dev switch0 show
sleep 4
echo
echo "done, bye..."
exit 0
3. Another script experimental:
# root@wifi02:~# cat ip-mangle.sh
# Update the list of available packages
#opkg update
# Check package availability
#opkg list | grep "mod-tee"
# Install iptables-mod-tee package
#opkg install iptables-mod-tee
# Check if package installed successfully
opkg list-installed | grep "mod-tee"
echo ""
echo "port mirroring.."
echo ""
modprobe xt_TEE
iptables -t mangle -A PREROUTING -d 192.168.1.0/24 -j TEE --gateway 192.168.1.120
iptables -t mangle -A POSTROUTING ! -s 192.168.1.0/24 -j TEE --gateway 192.168.1.120