移植 iptables到arm linux

发布于 2022-09-28 10:21:26 字数 2962 浏览 8 评论 0

、编译内核,支持netfilter

在宿主机上进入Linux内核目录,配置所需的内核模块:

[root@localhost ~]# cd /root/kernel-2410/kernel-2410s/
#make menuconfig

选中如下内核选项:

General setup --->

  • Sysctl support (在ROMFS文件系统中/proc/sys/net/ipv4/出现ip_forward)
    Networking options --->

  • Network packet filtering (replaces ipchains)
    IP: Netfilter Configuration --->(全部选择即可)
    2、编译生成iptables命令
    [root@localhost ~]# cd /root/iiptables-1.2.11
    [root@localhost iptables-1.2.11]# make KERNEL_DIR=/root/kernel-2410/kernel-2410s/
    --------------------
    正常
    --------------------
    [root@localhost iptables-1.2.11]# make NO_SHARED_LIBS=1
    Extensions found:
    /opt/host/armv4l/bin/armv4l-unknown-linux-gcc -O2 -Wall -Wunused -I/usr/src/linux/include -Iinclude/ -DIPTABLES_VERSION=\"1.2.11\" -DNO_SHARED_LIBS=1 -D_UNKNOWN_KERNEL_POINTER_SIZE -D_INIT=ipt_conntrack_init -c -o extensions/libipt_conntrack.o extensions/libipt_conntrack.c
    In file included from extensions/libipt_conntrack.c:15:
    extensions/../include/linux/netfilter_ipv4/ipt_conntrack.h:29: `IP_CT_DIR_MAX' undeclared here (not in a function)
    extensions/../include/linux/netfilter_ipv4/ipt_conntrack.h:30: `IP_CT_DIR_MAX' undeclared here (not in a function)
    extensions/../include/linux/netfilter_ipv4/ipt_conntrack.h:30: `IP_CT_DIR_MAX' undeclared here (not in a function)
    extensions/libipt_conntrack.c: In function `parse_status':
    extensions/libipt_conntrack.c:110: `IPS_EXPECTED' undeclared (first use in this function)
    extensions/libipt_conntrack.c:110: (Each undeclared identifier is reported only once
    extensions/libipt_conntrack.c:110: for each function it appears in.)
    extensions/libipt_conntrack.c:112: `IPS_SEEN_REPLY' undeclared (first use in this function)
    extensions/libipt_conntrack.c:114: `IPS_ASSURED' undeclared (first use in this function)
    extensions/libipt_conntrack.c: In function `parse':
    extensions/libipt_conntrack.c:229: `IP_CT_DIR_ORIGINAL' undeclared (first use in this function)
    extensions/libipt_conntrack.c:286: `IP_CT_DIR_REPLY' undeclared (first use in this function)
    extensions/libipt_conntrack.c: In function `print_status':
    extensions/libipt_conntrack.c:395: `IPS_EXPECTED' undeclared (first use in this function)
    extensions/libipt_conntrack.c:399: `IPS_SEEN_REPLY' undeclared (first use in this function)
    extensions/libipt_conntrack.c:403: `IPS_ASSURED' undeclared (first use in this function)
    extensions/libipt_conntrack.c: In function `matchinfo_print':
    extensions/libipt_conntrack.c:457: `IP_CT_DIR_ORIGINAL' undeclared (first use in this function)
    extensions/libipt_conntrack.c:477: `IP_CT_DIR_REPLY' undeclared (first use in this function)
    make: *** [extensions/libipt_conntrack.o] 错误 1
    [root@localhost iptables-1.2.11]#

    谁移植过iptables,大家指点指点,谢谢!

  • 如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

    扫码二维码加入Web技术交流群

    发布评论

    需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

    评论(1

    深海蓝天 2022-10-05 10:21:26

    晕阿,发多了一个贴,唔好意思哦

    ~没有更多了~
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文