一般的流量镜像需要在交换机上做,实际上iptables也有个tee模块做流量镜像。在OpenWrt里使用也比较简单。1. 把tee模块安装上加载进去(需要依赖ipv6模块)```bash opkg install kmod-ipt-tee 2.把某个源IP的包镜像发到指定的IPiptables -t mangle -A PREROUTING -s 192.168.3.224 -j TEE –gateway 192.168.3.100


4. 删除规则iptables -t mangle -F

5. 也可以把整个网段的都镜像root@wan:/etc/config# iptables -t mangle -A PREROUTING -s 192.168.3.0/24 -j TEE –gateway 192.168.3.100root@wan:/etc/config# iptables -t mangle -A POSTROUTING -d 192.168.3.0/24 -j TEE –gateway 192.168.3.100

tee

上图是抓包手机 微博和易讯客户端打开的的DNS查询。