今天,我在主机系统上的iptables 停止工作了,我不知道发生了什么!(这很糟糕,我知道)
所有命令均以root用户身份执行。
如果我运行,$ iptables -t nat -L
则会收到以下错误消息:
$ iptables -t nat -L
iptables v1.4.7: can't initialize iptables table `nat': Table does not exist (do you need to insmod?)
Perhaps iptables or your kernel needs to be upgraded.
没有更多可用的更新。我还使用多个较旧的内核重新启动了服务器,但始终收到相同的错误消息。
我的服务器在CentOS上运行,带有最新版本的官方OpenVZ内核。
$ uname -r
2.6.32-042stab088.4
还测试了内核版本:2.6.32-042stab85.20和2.6.32-042stab084.26
grub.conf中的第一个内核:
title OpenVZ (2.6.32-042stab088.4)
root (hd0,1)
kernel /vmlinuz-2.6.32-042stab088.4 ro root=/dev/md2 rd_NO_LUKS rd_NO_DM nomodeset crashkernel=auto SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 KEYTABLE=de
initrd /initramfs-2.6.32-042stab088.4.img
已安装以下更新:
$ rpm -qa --last
vzctl-4.7.2-1.x86_64 Mon 05 May 2014 03:25:16 AM CEST
vzctl-core-4.7.2-1.x86_64 Mon 05 May 2014 03:25:14 AM CEST
util-linux-ng-2.17.2-12.14.el6_5.x86_64 Wed 30 Apr 2014 11:37:19 PM CEST
libuuid-2.17.2-12.14.el6_5.x86_64 Wed 30 Apr 2014 11:37:18 PM CEST
libblkid-2.17.2-12.14.el6_5.x86_64 Wed 30 Apr 2014 11:37:18 PM CEST
vzkernel-2.6.32-042stab088.4.x86_64 Mon 26 Apr 2014 09:01:00 AM CEST
nss-softokn-freebl-3.14.3-10.el6_5.x86_64 Sat 26 Apr 2014 09:01:00 AM CEST
nss-softokn-3.14.3-10.el6_5.x86_64 Sat 26 Apr 2014 09:01:00 AM CEST
bridge-utils-1.2-10.el6.x86_64 Tue 15 Apr 2014 02:22:41 PM CEST
openssl-1.0.1e-16.el6_5.7.x86_64 Wed 09 Apr 2014 10:14:03 AM CEST
...
lsmod
给我以下内容:
$ lsmod | grep ip
iptable_nat 6302 0
nf_nat 23213 2 iptable_nat,vzrst
nf_conntrack_ipv4 9946 3 iptable_nat,nf_nat
nf_defrag_ipv4 1531 1 nf_conntrack_ipv4
nf_conntrack 80281 5 iptable_nat,vzrst,nf_nat,nf_conntrack_ipv4,vzcpt
ip6t_REJECT 4711 0
ip6table_mangle 3669 0
ip6table_filter 3033 0
ip6_tables 18988 2 ip6table_mangle,ip6table_filter
iptable_mangle 3493 0
iptable_filter 2937 0
xt_multiport 2716 0
ipt_REJECT 2399 0
ip_tables 18119 3 iptable_nat,iptable_mangle,iptable_filter
ipv6 322519 35 vzrst,ip6t_REJECT,ip6table_mangle
运行modprobe会出现以下错误:
$ modprobe /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko
FATAL: Module /lib/modules/2.6.32_042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko not found.
但是该文件确实存在:
$ ll /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko
-rwxr--r-- 1 root root 16K Apr 3 16:20 /lib/modules/2.6.32-042stab088.4/kernel/net/ipv4/netfilter/iptable_nat.ko*
有任何想法吗?