第一种
如果说nat名字是大写的NAT 试试iptables -tnat -L
原因是如果使用命令iptables -tNAT -L 是没有NAT表的也会出现这个错误
第二种:
该错误完整应该是这样的:
can‘t initialize iptables table `nat‘: Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
首先
[[email protected] ~]# modprobe -l|grep iptable_nat
kernel/net/ipv4/netfilter/iptable_nat.ko
[[email protected] ~]#
尝试如下操作
[[email protected] ~]# modinfo iptable_nat
filename: /lib/modules/2.6.32-431.el6.x86_64/kernel/net/ipv4/netfilter/iptable_nat.ko
alias: ip_nat
license: GPL
srcversion: 507BCAD1E3A207FDF875EEC
depends: ip_tables,nf_conntrack_ipv4,nf_nat,nf_conntrack
vermagic: 2.6.32-431.el6.x86_64 SMP mod_unload modversions
[[email protected] ~]# insmod /lib/modules/2.6.32-431.el6.x86_64/kernel/net/ipv4/netfilter/iptable_nat.ko
insmod:error inserting ‘iptable_nat.ko‘:-1 unknown symbol in module
[[email protected] ~]# modprobe iptable_nat
[[email protected] ~]#
即可
第三种情况:
[[email protected] ~]# ll /lib/modules/
total 4
drwxr-xr-x. 8 root root 4096 Mar 7 11:11 2.6.32-431.el6.x86_64
[[email protected] ~]#
[[email protected] ~]# uname -r
2.6.32-431.el6.x86_64
[[email protected] ~]#
是否本地的kernel 的模块和kernel相对应 多出现的原因为 升级过内核。。 但是本地还是老版本的模块 安装当前kernel 的包即可
can't initialize iptables table `nat': Table does not exist