温馨提示×

温馨提示×

您好,登录后才能下订单哦!

密码登录×
登录注册×
其他方式登录
点击 登录注册 即表示同意《亿速云用户服务条款》

SAIL-AM335x中wifi作为热点后,其他设备通过该wifi热点,可以访问外部网络的方法

发布时间:2020-07-06 03:35:06 来源:网络 阅读:201 作者:电鱼电子 栏目:系统运维

今天与大家分享的是sail-am335x中wifi作为热点后,其他设备通过该wifi热点,访问外部网络的方法,具体的方法步骤如下:

1.335x前边已经移植好了hostapd;直接使用就可以热点名为rtwap,密码为87654321

2.dhcpd 配置文件修改

创建空文件/var/db/dhcpd.leases

mkdir -p /var/db

touch /var/db/dhcpd.leases

3.ifconfig eth0 up

udhcpc -i eth0

ifconfig wlan0 up

ifconfig wlan0 10.5.5.1 netmask 255.255.255.0

echo 1 >/proc/sys/net/ipv4/ip_forward /打开IP转发/

/sbin/iptables -t nat -A POSTROUTING -oeth0 -j MASQUERADE

设置网卡的混杂模式

ifconfig wlan0 promisc

[ 3725.324000] device wlan0 enteredpromiscuous mode

dhcpd -cf /etc/dhcpd.conf wlan0 &

hostapd /etc/hostapd.conf -B

4.前边命令中需要用到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-shared

make

make install

编译完成后需要将iptables移植到开发板上;

内核中也需要配置iptables的支持

[*] Networking support --->

  Networking options  --->

          [*] Network packet filteringframework (Netfilter)  --->

                 Core NetfilterConfiguration  --->(全部选上)

                 IP: NetfilterConfiguration  --->(全部选上)

c��~YM�L:ϸ 335x中wifi作为热点后,其他设备通过该wifi热点,可以访问外部网络的方法

1.335x前边已经移植好了hostapd;直接使用就可以热点名为rtwap,密码为87654321

2.dhcpd 配置文件修改

创建空文件/var/db/dhcpd.leases

mkdir -p /var/db

touch /var/db/dhcpd.leases

3.

ifconfig eth0 up

udhcpc -i eth0

ifconfig wlan0 up

ifconfig wlan0 10.5.5.1 netmask 255.255.255.0

echo 1 >/proc/sys/net/ipv4/ip_forward /打开IP转发/

/sbin/iptables -t nat -A POSTROUTING -oeth0 -j MASQUERADE

设置网卡的混杂模式

ifconfig wlan0 promisc

[ 3725.324000] device wlan0 enteredpromiscuous mode

dhcpd -cf /etc/dhcpd.conf wlan0 &

hostapd /etc/hostapd.conf -B

4.前边命令中需要用到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-shared

make

make install

编译完成后需要将iptables移植到开发板上;

内核中也需要配置iptables的支持

[*] Networking support --->

  Networking options  --->

          [*] Network packet filteringframework (Netfilter)  --->

                 Core NetfilterConfiguration  --->(全部选上)

                 IP: NetfilterConfiguration  --->(全部选上)

以上步骤是基于电鱼电子的sail-am335开发板为例来实现的。

这样通过这几个小步骤以后,其他设备通过该wifi热点,可以成功连接到外部网络啦~

向AI问一下细节

免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。

AI