sail-am335x用wifi访问外网
sail-am335x中wifi作为热点后,其他设备通过该wifi热点,可以访问外部网络的方法sail-am335x中在WiFi已经作为热点之后,其他设备发现无法连接外部网络,本篇将介绍方法。1.335x前边已经移植好了hostapd;直接使用就可以 热点名为rtwap,密码为876543212.dhcpd 配置文件修改创建空文件/var/db/dhcpd.leasesmkdir -p /var/dbtouch /var/db/dhcpd.leases3.ifconfig eth0 upudhcpc -i eth0ifconfig wlan0 up ifconfig wlan0 10.5.5.1 netmask 255.255.255.0echo 1 > /proc/sys/net/ipv4/ip_forward /* 打开IP转发 */sbin/iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE设置网卡的混杂模式# ifconfig wlan0 promisc 3725.324000 device wlan0 entered promiscuous modedhcpd -cf /etc/dhcpd.conf wlan0 &hostapd /etc/hostapd.conf -B4.前边命令中需要用到iptables,文件系统中需要移植iptables (iptables编译)./configure -host=arm-arago-linux-gnueabi -prefix=/root/335x/localcode/iptables/install -disable-nftables -with-ksource=/root/335x/localcode/kernel-3.2.0 -enable-static -disable-sharedmake make install编译完成后需要将iptables移植到开发板上;内核中也需要配置iptables的支持* Networking support -> Networking options -> * Network packet filtering framework (Netfilter) -> Core Netfilter Configuration ->(全部选上) IP: Netfilter Configuration -> (全部选上)这个方法方便简捷,大家学会了快去试试吧,还有更多有关SAIL-AM335就在www.dianyu.net!