新聞中心

        EEPW首頁 > 嵌入式系統(tǒng) > 設計應用 > iptables1.4.12.1移植到arm平臺

        iptables1.4.12.1移植到arm平臺

        作者: 時間:2016-11-09 來源:網絡 收藏
        平臺介紹:主機端—ubuntu11.04

        開發(fā)板內核—linux-2.6.30

        本文引用地址:http://www.104case.com/article/201611/317663.htm

        iptables版本—1.4.12.1

        移植過程:

        內核需要對iptables的支持并加上nat功能

        Networking support --->

        Networking options --->

        Network packet filtering framework (Netfilter)

        │ │ --- Network packet filtering framework (Netfilter) │ │

        │ │ [*] Network packet filtering debugging │ │

        │ │ [*] Advanced netfilter configuration │ │

        │ │ Core Netfilter Configuration ---> │ │

        │ │ < > IP virtual server support ---> │ │

        │ │ IP: Netfilter Configuration --->

        Core Netfilter Configuration里面的配置如下:

        <*> Netfilter connection tracking support

        -*- Netfilter Xtables support (required for ip_tables)

        IP: Netfilter Configuration里面的配置如下:

        [*] proc/sysctl compatibility with old connection tracking

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

        <*> Packet filtering

        <*> REJECT target support

        < > LOG target support

        < > ULOG target support

        <*> Full NAT

        <*> MASQUERADE target support

        <*> NETMAP target support

        <*> REDIRECT target support

        <*> Basic SNMP-ALG support

        重新編譯。

        進入iptables目錄,運行configure文件

        ./configure --prefix=/opt/iptables/ --host=arm-linux --with-ksource=/root/linux-2.6.30/

        make

        make install

        進入/opt/iptables/目錄看看吧,應該生成了可執(zhí)行文件。

        使用無線網卡建立無線網絡,通過eth0來做nat轉換上網,需要使用防火墻和內核的nat功能,配置命令如下:

        //把所有192.168.0.0網絡的數(shù)據(jù)交由eth0來處理
        iptables -t nat -A POSTROUTING -o eth0 -s 192.168.0.0/24 -j MASQUERADE
        iptables -t nat -A POSTROUTING -j MASQUERADE
        iptables -F FORWARD

        這樣所有無線網絡客戶端就可以都可以上網了



        評論


        相關推薦

        技術專區(qū)

        關閉
        主站蜘蛛池模板: 策勒县| 赤城县| 来宾市| 昌吉市| 互助| 桑日县| 清流县| 灵丘县| 宁阳县| 稻城县| 富民县| 太原市| 伊金霍洛旗| 博乐市| 永靖县| 鄯善县| 大港区| 贺兰县| 牟定县| 南澳县| 驻马店市| 龙南县| 金华市| 澎湖县| 柘城县| 鄂伦春自治旗| 青州市| 霍城县| 岑溪市| 新昌县| 蓝田县| 靖宇县| 隆德县| 丹东市| 新兴县| 于田县| 花莲市| 左云县| 扎赉特旗| 苍南县| 龙南县|