Skip to main content

報錯:iptables v1.8.9 (legacy): can't initialize iptables table `filter': Table does not exist (do you need to insmod?)

背景: 使用docker安裝v2ray的時候,添加配置時,報以上錯誤,且v2ray無法啓動。

解決方案: 沒有加載iptable_filter模塊,按照以下操作:

#查看是否開啓filter模塊,沒加載該模塊時,返回空内容。
lsmod | grep iptable_filter
iptable_filter 12288 1
ip_tables 32768 1 iptable_filter
#法1:臨時加載filter模塊,重啓電腦失效
modprobe iptable_filter
#法2:永久生效
echo "modprobe iptable_filter" >> /etc/rc.local

還可能是以下原因導致,僅供參考:

确保iptables版本与内核版本兼容。可以尝试升级iptables到最新版本,或者降级内核到与iptables兼容的版本。

如果使用的是自定义内核,确保已正确配置了iptables支持。在编译内核时,需要启用与iptables相关的配置选项,如 CONFIG_NETFILTER_XTABLESCONFIG_IP_NF_FILTER