渠道介绍:主机端—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
这样一切无线网络客户端就可以都可以上网了