After wifi is used as a hotspot in SAIL-AM335x, other devices can access the external network through the wifi hotspot.
What I want to share with you today is the method for other devices to access the external network through the wifi hotspot in sail-am335x through the wifi hotspot. The specific steps are as follows:
1.335x has been transplanted before the hostapd; can be directly used as rtwap, the password is 87654321
2.dhcpd profile modification
Create an empty file / 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 / turn on IP forwarding /
/ sbin/iptables-t nat-A POSTROUTING-oeth0-j MASQUERADE
Set the promiscuous mode of the network card
Ifconfig wlan0 promisc
[3725.324000] device wlan0 enteredpromiscuous mode
Dhcpd-cf / etc/dhcpd.conf wlan0 &
Hostapd / etc/hostapd.conf-B
4. Iptables is needed in the previous command, and iptables needs to be migrated in the file system (iptables compilation)
. / 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
After compilation, you need to port iptables to the development board.
Iptables support also needs to be configured in the kernel
[*] Networking support->
Networking options-- > [*] Network packet filteringframework (Netfilter)-- > Core NetfilterConfiguration-- > (all selected) IP: NetfilterConfiguration-- > (all selected)
C method that other devices can access the external network through the YM hotspot after wifi is used as a hotspot in the wifi hotspot.
1.335x has been transplanted before the hostapd; can be directly used as rtwap, the password is 87654321
2.dhcpd profile modification
Create an empty file / 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 / turn on IP forwarding /
/ sbin/iptables-t nat-A POSTROUTING-oeth0-j MASQUERADE
Set the promiscuous mode of the network card
Ifconfig wlan0 promisc
[3725.324000] device wlan0 enteredpromiscuous mode
Dhcpd-cf / etc/dhcpd.conf wlan0 &
Hostapd / etc/hostapd.conf-B
4. Iptables is needed in the previous command, and iptables needs to be migrated in the file system (iptables compilation)
. / 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
After compilation, you need to port iptables to the development board.
Iptables support also needs to be configured in the kernel
[*] Networking support->
Networking options-- > [*] Network packet filteringframework (Netfilter)-- > Core NetfilterConfiguration-- > (all selected) IP: NetfilterConfiguration-- > (all selected)
The above steps are based on the sail-am335 development board of Electric Fish Electronics as an example.
After these small steps, other devices can successfully connect to the external network through the wifi hotspot.