一、內核環境:
linux-3.4.35
-*- Networking support ?--->
Networking options ?--->
[*] Network packet filtering framework (Netfilter) ?--->
IP: Netfilter Configuration ?--->
<*> IP tables support (required for filtering/masq/NAT) //iptables
<*> "ah" match support //允許對IPSec包頭的AH字段進行匹配?
<*> "ecn" match support //允許對TCP/IP包頭的ECN(Explicit?Congestion?Notification)字段進行匹配.ECN是一種顯式擁塞通知技術,它不但要求路由器支持而且要求端到端主機的支持,其基本思想是當路由器發生早期擁塞時不是丟棄包而是盡量對包進行標記,接收方接到帶有ECN提示的包時,通知發送方網絡即將發生擁塞,也就是它通過對包的標記提示TCP源即將發生擁塞,從而引發擁塞避免算法?
<*> "rpfilter" reverse path filter match support //rpfilter反向路徑過濾
<*> "ttl" match support //允許對ip包頭的TTL(生存期)字段進行匹配?
<*> Packet filtering //定義filter表以允許對包進行過濾?
<*> REJECT target support //允許返回一個ICMP錯誤而不是簡單的丟棄包?
[*] Force socket error when rejecting with icmp*?
<*> ULOG target support //透過netlink?socket將符合條件的封包交給用戶空間的ulogd守護進程.反對使用該選項,因為它已經被NETFILTER_NETLINK_LOG代替?
<*> Packet mangling //在iptables中啟用mangle表以便對包進行各種修改,常用于改變包的路由?
<*> ECN target support?
<*> "TTL" target support?
<*> raw table support (required for NOTRACK/TRACE) //在iptables中添加一個'raw'表,該表在netfilter框架中非常靠前,并在PREROUTING和OUTPUT鏈上有鉤子,從而可以對收到的數據包在連接跟蹤前進行處理
二、軟件移植
基于:iptables-1.4.22.tar.bz2
解壓:tar xvf?iptables-1.4.22.tar.bz2
配置:./configure --host=arm-hisiv400-linux --enable-static --disable-shared --prefix=/home/liuzhengwu/share/Source/App/iptables/iptables-1.4.12/_install --disable-ipv6 --disable-largefile
編譯:make -j4
如果編譯報錯:
解決方法:sed ?-i ?'/if_packet/i#define __aligned_u64 __u64 __attribute__((aligned(8)))' ? ?extensions/libxt_pkttype.c
安裝:make install
去符號表:arm-hisiv400-linux-strip?_install/sbin/xtables-multi
拷貝給開發板:mv _install/sbin/xtables-multi /開發板/rootfs/usr/sbin/iptables
//---------------------------------------------------------------------------------------------------------------------//
基于:iptables-1.6.1.tar.bz2
解壓:tar xvf?iptables-1.6.1.tar.bz2
配置:./configure --host=arm-hi3516cv300-linux --enable-static --disable-shared --prefix=/home/liuzhengwu/share/Source/App/iptables/iptables-1.6.1/_install --disable-ipv6 --disable-largefile --disable-nftables
編譯:make -j4
安裝:make install
去符號表:arm-hi3516cv300-linux-strip?_install/sbin/xtables-multi
拷貝給開發板:mv?_install/sbin/xtables-multi /開發板/rootfs/usr/sbin/iptables
ERROR: ld.so: object '/media/work/cz/work/WiFi_Evaluate/BRCM/hangshen/wpa_supplicant_build_new/need_libs/openssl-1.0.1g/util/../libcrypto.so.1.0.0' from LD_PRELOAD cannot be preloaded (wrong ELF class: ELFCLASS32): ignored.
解決方法:
# echo "" > /etc/ld.so.preload
64位系統沒有這個文件導致報錯