目录
功能说明:
net\netfilter\Kconfig
config NETFILTER_XT_TARGET_TEE
tristate '"TEE" - packet cloning to alternate destination'
可以将设备接口的报文重定向到一个ip。
如将wan接口报文,重定向到eth0 ip
将无线wl0接口报文,重定向到eth1 ip
1.kernel加载netfilter 扩展模块
net/netfilter/xt_TEE.c
obj-$(CONFIG_NETFILTER_XT_TARGET_TEE) += xt_TEE.o
modprob xt_TEE.ko
lsmod
xt_TEE 16384 2
nf_dup_ipv6 16384 1 xt_TEE
nf_dup_ipv4 16384 1 xt_TEE
x_tables 36864 4 ip_tables,xt_tcpudp,xt_TEE,iptable_filter
2.使用实例
eth0 局域网: 192.168.0.1
eth1 wan网:
2.1 eth1 的所有报文镜像到 eth0
iptables -A INPUT -i eth1 -j TEE --gateway 192.168.0.1
iptables -A OUTPUT -o eth1 -j TEE --gateway 192.168.0.1
2.2 镜像指定的报文
iptables -A INPUT -i eth1 -p tcp -m tcp -j TEE --gateway 192.168.56.1
iptables -A OUTPUT -o eth1 -p tcp -m tcp -j TEE --gateway 192.168.56.1
3.其它实例
https://blog.csdn.net/mounter625/article/details/43489623 -->未在PREROUTING链 验证过