linux iptables启动问题

来源:互联网 发布:任志强为什么没事 知乎 编辑:程序博客网 时间:2024/06/03 16:21

    近期在公司需要在板子上启动iptables,具体什么板子就不说了,涉及到公司内部产品。不过google出来的修改方式都大同小异,再次做下整理,便于以后使用。

    首先是奇葩的报错信息:

    can't initialize iptables table `filter': iptables who? (do you need to insmod?)

    Perhaps iptables or your kernel needs to be upgraded.

    google中的解决办法主要为:

    1.make menuconfig

    2.-*- Networking support  --->

            Networking options  --->

                  [*] Network packet filtering framework (Netfilter)  --->

                        Core Netfilter Configuration  ---> 

                             <*> Netfilter NFQUEUE over NFNETLINK interfac

                            <*> Netfilter LOG over NFNETLINK interface
                            <M> nfmark target and match support

                             <*> Netfilter Xtables support (required for ip_tables)

                        IP: Netfilter Configuration  --->

                             <*> IP tables support (required for filtering/masq/NAT)

                             <*>   raw table support (required for NOTRACK/TRACE)

    不过我在实际测试时,如此操作的时候还是会报该错,使用内核为linux-3.0系列。

    后期启用如下几个模块则可以正常跑起来。

    Network support →
      Networking options →
        Network packet filter framwork (netfilter)→
            IP:NETFilter configuration→
                 [*]FULL NAT
                 [*]IPTABLES Support

    3.make && make modules

    4.make modules_install  && make install

    5.rsync  -r  -v  /lib/modules/  /XXX/modules/ 将modules、内核镜像、配置文件复制到对应目录即可。

 

    因为对内核学习也开始刚刚起步了解,其中有很多不甚了解的东西,在此仅仅做个记录,便于以后查询,至于以上是否有什么错误,留待验证。

 

原创粉丝点击