您好,登錄后才能下訂單哦!
今天與大家分享的是sail-am335x中wifi作為熱點(diǎn)后,其他設(shè)備通過該wifi熱點(diǎn),訪問外部網(wǎng)絡(luò)的方法,具體的方法步驟如下:
1.335x前邊已經(jīng)移植好了hostapd;直接使用就可以熱點(diǎn)名為rtwap,密碼為87654321
2.dhcpd 配置文件修改
創(chuàng)建空文件/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轉(zhuǎn)發(fā)/
/sbin/iptables -t nat -A POSTROUTING -oeth0 -j MASQUERADE
設(shè)置網(wǎng)卡的混雜模式
[ 3725.324000] device wlan0 enteredpromiscuous mode
dhcpd -cf /etc/dhcpd.conf wlan0 &
hostapd /etc/hostapd.conf -B
4.前邊命令中需要用到iptables,文件系統(tǒng)中需要移植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移植到開發(fā)板上;
內(nèi)核中也需要配置iptables的支持
[*] Networking support --->
Networking options --->
[*] Network packet filteringframework (Netfilter) --->
Core NetfilterConfiguration --->(全部選上)
IP: NetfilterConfiguration --->(全部選上)
c??~YM?L:? 335x中wifi作為熱點(diǎn)后,其他設(shè)備通過該wifi熱點(diǎn),可以訪問外部網(wǎng)絡(luò)的方法
1.335x前邊已經(jīng)移植好了hostapd;直接使用就可以熱點(diǎn)名為rtwap,密碼為87654321
2.dhcpd 配置文件修改
創(chuàng)建空文件/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轉(zhuǎn)發(fā)/
/sbin/iptables -t nat -A POSTROUTING -oeth0 -j MASQUERADE
設(shè)置網(wǎng)卡的混雜模式
[ 3725.324000] device wlan0 enteredpromiscuous mode
dhcpd -cf /etc/dhcpd.conf wlan0 &
hostapd /etc/hostapd.conf -B
4.前邊命令中需要用到iptables,文件系統(tǒng)中需要移植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移植到開發(fā)板上;
內(nèi)核中也需要配置iptables的支持
[*] Networking support --->
Networking options --->
[*] Network packet filteringframework (Netfilter) --->
Core NetfilterConfiguration --->(全部選上)
IP: NetfilterConfiguration --->(全部選上)
以上步驟是基于電魚電子的sail-am335開發(fā)板為例來實(shí)現(xiàn)的。
這樣通過這幾個(gè)小步驟以后,其他設(shè)備通過該wifi熱點(diǎn),可以成功連接到外部網(wǎng)絡(luò)啦~
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報(bào),并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。