当前位置:   article > 正文

ip6tables v1.8.7 (legacy): Couldn‘t load match `pkttype‘:No such file or directory_iptables-restore v1.8.7(legacy):counldn't load mat

iptables-restore v1.8.7(legacy):counldn't load match 'limit

最近在做openThread协议的边界路由器otbr,在构建otbr时有如下原始报错:

  1. + have update-rc.d
  2. + command -v update-rc.d
  3. + sudo update-rc.d otbr-firewall remove
  4. + test '!' -f /etc/init.d/otbr-firewall
  5. + sudo rm /etc/init.d/otbr-firewall
  6. + firewall_install
  7. + sudo cp script/otbr-firewall /etc/init.d/otbr-firewall
  8. + sudo chmod a+x /etc/init.d/otbr-firewall
  9. + have systemctl
  10. + command -v systemctl
  11. + sudo systemctl enable otbr-firewall
  12. otbr-firewall.service is not a native service, redirecting to systemd-sysv-install.
  13. Executing: /lib/systemd/systemd-sysv-install enable otbr-firewall
  14. + sudo systemctl start otbr-firewall
  15. Job for otbr-firewall.service failed because the control process exited with error code.
  16. See "systemctl status otbr-firewall.service" and "journalctl -xe" for details.
  17. + die 'Failed to start firewall service!'
  18. + echo ' *** ERROR: Failed to start firewall service!'
  19. *** ERROR: Failed to start firewall service!
  20. + exit 1

按照提示,执行: systemctl status otbr-firewall.service,有如下详细报错信息:

  1. root@xxxx:/xxxx/ot-br-posix# systemctl status otbr-firewall.service
  2. * otbr-firewall.service - LSB: OTBR firewall
  3. Loaded: loaded (/etc/init.d/otbr-firewall; generated)
  4. Active: failed (Result: exit-code) since Sun 2022-03-20 19:56:09 UTC; 1min 47s ago
  5. Docs: man:systemd-sysv-generator(8)
  6. Process: 918 ExecStart=/etc/init.d/otbr-firewall start (code=exited, status=2)
  7. Mar 20 19:56:09 xxxx otbr-firewall[918]: + ipset create -exist otbr-ingress-allow-dst hash:net family inet6
  8. Mar 20 19:56:09 xxxx otbr-firewall[918]: + ipset create -exist otbr-ingress-allow-dst-swap hash:net family inet6
  9. Mar 20 19:56:09 xxxx otbr-firewall[918]: + ip6tables -N OTBR_FORWARD_INGRESS
  10. Mar 20 19:56:09 xxxx otbr-firewall[918]: + ip6tables -I FORWARD 1 -o wpan0 -j OTBR_FORWARD_INGRESS
  11. Mar 20 19:56:09 xxxx otbr-firewall[918]: + ip6tables -A OTBR_FORWARD_INGRESS -m pkttype --pkt-type unicast -i wpan0 -j DROP
  12. Mar 20 19:56:09 xxxx otbr-firewall[944]: ip6tables v1.8.7 (legacy): Couldn't load match `pkttype':No such file or directory
  13. Mar 20 19:56:09 xxxx otbr-firewall[944]: Try `ip6tables -h' or 'ip6tables --help' for more information.
  14. Mar 20 19:56:09 xxxx systemd[1]: otbr-firewall.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
  15. Mar 20 19:56:09 xxxx systemd[1]: otbr-firewall.service: Failed with result 'exit-code'.
  16. Mar 20 19:56:09 xxxx systemd[1]: Failed to start LSB: OTBR firewall.

发现了如题所示的错误信息:ip6tables v1.8.7 (legacy): Couldn't load match `pkttype':No such file or directory

此错误即为/etc/init.d/otbr-firewall中的一条命令ip6tables -A $OTBR_FORWARD_INGRESS_CHAIN -m pkttype --pkt-type unicast -i $THREAD_IF -j DROP执行时报错。

根据字面意思,也是iptables的内核缺少相应的配置,进入内核执行:

#make menuconfig

-->Networking support > Networking options > Network packet filtering framework (Netfilter) > Core Netfilter Configuration在这个里面就能发现相应的类型支持,选上、重新编译、烧录即可。

验证测试,成功解决问题!

参考构建OTBR的其他类似错误:ipset v7.10: Kernel error received: set type not supported

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小蓝xlanll/article/detail/397792
推荐阅读
相关标签
  

闽ICP备14008679号