不知为何,即使Core Netfilter Configuration和IP: Netfilter Configuration全部采用built-in还是提示这个错误,后来改成module的方式依然不行,最后找到原因是因为它不会自动加载所需要的模块,手动加载即可,modprobe xt_MARK
[root@mpc8315erdb /root]# iptables -t mangle -A PREROUTING -s 192.168.2.0/24 -j
MARK --set-mark 1
iptables: No chain/target/match by that name
[root@mpc8315erdb /root]# modprobe xt_MARK
[root@mpc8315erdb /root]# iptables -t mangle -A PREROUTING -s 192.168.2.0/24 -j
MARK --set-mark 1
[root@mpc8315erdb /root]# iptables -t mangle -L
Chain PREROUTING (policy ACCEPT)
target prot opt source destination
MARK all -- 192.168.2.0/24 anywhere MARK xset 0x1/0xffffffff
Chain INPUT (policy ACCEPT)
target prot opt source destination
Chain FORWARD (policy ACCEPT)
target prot opt source destination
Chain OUTPUT (policy ACCEPT)
target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
target prot opt source destination
本文记录了一次解决iptables中使用MARK命令出现的问题的过程。作者尝试了多种配置方式但依旧遇到错误提示,最终发现原因是缺少必要的内核模块加载,并通过手动加载模块解决了问题。
3718

被折叠的 条评论
为什么被折叠?



