iptables-1.4.12.1移植到arm平台

 

平台介绍:主机端—ubuntu11.04

                     开发板内核—linux-2.6.30

          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/目录看看吧,应该生成了可执行文件。

使用无线网卡建立无线网络,通过eth0来做nat转换上网,需要使用防火墙和内核的nat功能,配置命令如下:

 //把所有192.168.0.0网络的数据交由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

这样所有无线网络客户端就可以都可以上网了

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值