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

今天与大家分享的是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热点,可以成功连接到外部网络啦~

分享文章:SAIL-AM335x中wifi作为热点后,其他设备通过该wifi热点,可以访问外部网络的方法
文章路径:https://www.cdcxhl.com/article32/gpicsc.html

成都网站建设公司_创新互联,为您提供网站设计网站设计公司网站收录ChatGPT电子商务静态网站

广告

声明:本网站发布的内容(图片、视频和文字)以用户投稿、用户转载内容为主,如果涉及侵权请尽快告知,我们将会在第一时间删除。文章观点不代表本网站立场,如需处理请联系客服。电话:028-86922220;邮箱:631063699@qq.com。内容未经允许不得转载,或转载时需注明来源: 创新互联

手机网站建设