AP6275P PCIe NIC creates WIFI hotspot via create ap
create_ap is a script that helps quickly create WIFI hotspots on Linux, and supports bridge and NAT modes. It can automatically combine hostapd, dnsmasq and iptables to complete the setting of WIFI hotspots, avoiding complex configuration for users. The github address is as follows: |
If you using the latest image, the create_ap script has been pre-installed, and you can create a WIFI hotspot through the create_ap command. The basic command format of create_ap is as follows: create_ap [options] <wifi-interface> [<interface-with-internet>] |
1.create_ap method to create WIFI hotspot in NAT mode
1) Enter the following command to create a WIFI hotspot named orangepi and password orangepi in NAT mode
orangepi@orangepi5:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi |
2) If the following information is output, it means that the WIFI hotspot is created successfully
orangepi@orangepi5:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi Config dir: /tmp/create_ap.wlan0.conf.fPItFUJ2 PID: 3831 |
3) Take out the mobile phone at this time, in the searched WIFI list, you can find the WIFI hotspot named orangepi created by the development board, and then click orangepi to connect to the hotspot, the password is the orangepi set above
4) After the connection is successful, the display is as shown in the figure below
5) In NAT mode, the wireless device connected to the hotspot of the development board requests an IP address from the DHCP service of the development board, so there will be two different network segments, for example, the IP of the development board is 192.168.1.X
orangepi@orangepi5:~$ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
By default, the DHCP service of the development board will assign an IP address of 192.168.12.0/24 to the device connected to the hotspot. At this time, click on the connected WIFI hotspot orangepi, and then you can see that the IP address of the mobile phone is 192.168.12.X
6) If you want to specify a different network segment for the connected device, you can specify it through the -g parameter, such as specifying the network segment of the access point AP through the -g parameter as 192.168.2.1
orangepi@orangepi5:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 |
At this time, after connecting to the hotspot through the mobile phone, click the connected WIFI hotspot orangepi, and then you can see that the IP address of the mobile phone is 192.168.2.X
7) If the --freq-band parameter is not specified, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify it through the --freq-band 5 parameter. The specific command is as follows
orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 |
8) If you need to hide the SSID, you can specify the --hidden parameter, the specific command is as follows
orangepi@orangepi:~$ sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden |
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the name of the WIFI hotspot and enter the password to connect to the WIFI hotspot
2.create_ap method to create WIFI hotspot in bridge mode
1) Enter the following command to create a WIFI hotspot named orangepi and password orangepi in bridge mode
orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi |
2) If the following information is output, it means that the WIFI hotspot is created successfully
orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi [sudo] password for orangepi: |
3) Take out the mobile phone at this time, and you can find the WIFI hotspot named orangepi created by the development board in the searched WIFI list, and then you can click orangepi to connect to the hotspot, and the password is the orangepi set above
4) After the connection is successful, the display is as shown in the figure below
5) In bridge mode, the wireless device connected to the hotspot of the development board also requests an IP address from the DHCP service of the main router (the router connected to the development board), for example, the IP of the development board is 192.168.1.X
orangepi@orangepi:~$ ifconfig eth0 eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
|
The IP of the device connected to the WIFI hotspot is also assigned by the main router, so the mobile phone connected to the WIFI hotspot and the development board are in the same network segment. At this time, click on the connected WIFI hotspot orangepi, and then you can see the IP address of the mobile phone Also 192.168.1.X
6) If the --freq-band parameter is not specified, the hotspot created by default is in the 2.4G frequency band. If you want to create a hotspot in the 5G frequency band, you can specify the --freq-band 5 parameter. The specific command is as follows
orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5 |
7) If you need to hide the SSID, you can specify the --hidden parameter, the specific command is as follows
orangepi@orangepi:~$ sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden |
At this time, the mobile phone cannot search for the WIFI hotspot. You need to manually specify the name of the WIFI hotspot and enter the password to connect to the WIFI hotspot.