免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
12下一页
最近访问板块 发新帖
查看: 9831 | 回复: 17
打印 上一主题 下一主题

重编内核后iptables无法启动。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2006-03-28 18:26 |只看该作者 |倒序浏览
RHEL4 U3重新编译了2.6.16内核后,iptables 无法启动了。
提示信息如下:

[root@S1 ~]# service iptables start
Applying iptables firewall rules: iptables-restore v1.2.11: iptables-restore: unable to initializetable 'filter'

Error occurred at line: 3
Try `iptables-restore -h' or 'iptables-restore --help' for more information.
                                                           [FAILED]
[root@S1 ~]# uname -a
Linux S1 2.6.16 #1 Sat Mar 25 11:00:54 CST 2006 i686 i686 i386 GNU/Linux
[root@S1 ~]#

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
2 [报告]
发表于 2006-03-28 20:14 |只看该作者
手工执行一下
  1. modprobe ip_tables
  2. modprobe iptable_filter
复制代码

然后再 service iptables start 试试!

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
3 [报告]
发表于 2006-03-28 20:16 |只看该作者
另外,你可以把下面这个命令的执行结果发上来让大家看看:
  1. ls -al /lib/modules/`uname -r`/kernel/net/ipv4/netfilter
复制代码

如果这几个目录里面没有 ip_tables.ko iptable_filter.ko 这两个文件,
那么你可能需要在 kernel 源码里面执行一下 make install 命令:
  1. cd /usr/src/linux
  2. make install
复制代码


如果这个目录里面有这几个文件的话,
那么你可能需要先执行一下:
  1. depmod -a
复制代码

然后再试试。

[ 本帖最后由 flw 于 2006-3-28 20:20 编辑 ]

论坛徽章:
0
4 [报告]
发表于 2006-03-29 16:31 |只看该作者
[root@S2 ~]# modprobe ip_tables
FATAL: Module ip_tables not found.
[root@S2 ~]# modprobe iptable_filter
FATAL: Module iptable_filter not found.
[root@S2 ~]#


[root@S2 ~]# ls -al /lib/modules/2.6.16/kernel/net/ipv4/netfilter
total 1664
drwxr-xr-x  2 root root   4096 Mar 25 10:13 .
drwxr-xr-x  4 root root   4096 Mar 25 10:13 ..
-rw-r--r--  1 root root 142773 Mar 25 10:13 ip_conntrack_amanda.ko
-rw-r--r--  1 root root 158934 Mar 25 10:13 ip_conntrack_ftp.ko
-rw-r--r--  1 root root 151659 Mar 25 10:13 ip_conntrack_irc.ko
-rw-r--r--  1 root root 778223 Mar 25 10:13 ip_conntrack.ko
-rw-r--r--  1 root root 117161 Mar 25 10:13 ip_conntrack_proto_sctp.ko
-rw-r--r--  1 root root 140801 Mar 25 10:13 ip_conntrack_tftp.ko
-rw-r--r--  1 root root 167267 Mar 25 10:13 ip_queue.ko
[root@S2 ~]#

看来我在编译内核时(默认的,没有改动任何模块,直接保存编译的)没有编译那两个模块,真不感相信最新的内核默认没有这两项。我重编译一遍试试再说。
谢谢flw的大力支持。

[ 本帖最后由 JonZhao 于 2006-3-29 16:36 编辑 ]

论坛徽章:
0
5 [报告]
发表于 2006-03-29 16:55 |只看该作者
可能选择网络部分的 filter 的时候,没有选择全 netfilter 的部分
实在不行可以用 /boot/config-2.6.xx.xx 来代替 .config 去看一下,了解一下一些相关的依赖关系

论坛徽章:
0
6 [报告]
发表于 2006-03-31 10:41 |只看该作者
原帖由 flw 于 2006-3-28 20:14 发表
手工执行一下
  1. modprobe ip_tables
  2. modprobe iptable_filter
复制代码

然后再 service iptables start 试试!


提示没有这些模块。

论坛徽章:
0
7 [报告]
发表于 2006-03-31 10:41 |只看该作者
原帖由 flw 于 2006-3-28 20:16 发表
另外,你可以把下面这个命令的执行结果发上来让大家看看:
  1. ls -al /lib/modules/`uname -r`/kernel/net/ipv4/netfilter
复制代码

如果这几个目录里面没有 ip_tables.ko iptable_filter.ko 这两个文件,
那 ...


我是新编的内核,估计是没有编上这些模块。

论坛徽章:
0
8 [报告]
发表于 2006-03-31 10:43 |只看该作者
我从新编了一下,
选了一些我觉得相关的,可以还是没有那些模块。
这些模块到底是在哪儿选呀?

论坛徽章:
1
2015年辞旧岁徽章
日期:2015-03-03 16:54:15
9 [报告]
发表于 2006-03-31 11:03 |只看该作者
进入 make menuconfig 之后,按 / (斜杠),就可以进入搜索模式。
输入你想要的关键字,比如 iptables 就可以找到它的位置。

我这里是 2.6.15.6,我的位置是:
  1. Symbol: IP_NF_IPTABLES [=m]                                               
  2. Prompt: IP tables support (required for filtering/masq/NAT)               
  3.   Defined at net/ipv4/netfilter/Kconfig:183                              
  4.   Depends on: NET && INET && NETFILTER                                    
  5.   Location:                                                               
  6.     -> Networking                                                         
  7.       -> Networking support (NET [=y])                                    
  8.         -> Networking options                                             
  9.           -> Network packet filtering (replaces ipchains) (NETFILTER [=y])
  10.             -> IP: Netfilter Configuration                                
复制代码

[ 本帖最后由 flw 于 2006-3-31 11:07 编辑 ]

论坛徽章:
0
10 [报告]
发表于 2006-03-31 17:23 |只看该作者
经过重新编完内核后
[root@RHEL43 ~]# lsmod
Module                  Size  Used by
iptable_filter          3200  0
ip_tables              12248  1 iptable_filter
xt_tcpudp               3712  0
x_tables               12804  2 ip_tables,xt_tcpudp
autofs4                19204  0
dm_mirror              21456  0
dm_multipath           18696  0
dm_mod                 53400  2 dm_mirror,dm_multipath
button                  6928  0
battery                 9732  0
ac                      5252  0
ipv6                  227296  14
shpchp                 40608  0
i2c_piix4               8976  0
i2c_core               20992  1 i2c_piix4
pcnet32                27908  0
mii                     5632  1 pcnet32
floppy                 57156  0
ext3                  117768  1
jbd                    53524  1 ext3
mptscsih               33360  0
mptbase                47328  1 mptscsih
sd_mod                 16640  0
scsi_mod              127400  2 mptscsih,sd_mod
[root@RHEL43 ~]#

说明ip_iptables模块已经加载。
运行iptables提示如下。


[root@RHEL43 ~]# service iptables restart
Flushing firewall rules:                                   [  OK  ]
Setting chains to policy ACCEPT: filter                    [  OK  ]
Unloading iptables modules:                                [  OK  ]
Applying iptables firewall rules: iptables-restore: line 18 failed
                                                           [FAILED]
[root@RHEL43 ~]#

还是启动不了。
iptables 我重装过,问题还是一样。
晕咧,内核默认具然不加载ip_iptables模块,而且,还要开启其它的一个模块,ip_iptables模块才会出来。
想升级内核真是一波三折呀。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP