新闻中心

EEPW首页 > 嵌入式系统 > 设计应用 > iptables1.4.12.1移植到arm平台

iptables1.4.12.1移植到arm平台

作者:时间:2016-11-09来源:网络收藏
平台介绍:主机端—ubuntu11.04

开发板内核—linux-2.6.30

本文引用地址:http://www.eepw.com.cn/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/目录看看吧,应该生成了可执行文件。

使用无线网卡建立无线网络,通过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

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



评论


相关推荐

技术专区

关闭