8,367
edits
Changes
→AP6275P PCIe NIC creates WIFI hotspot via create_ap
|}
'''1.create_ap method to create WIFI hotspot in NAT mode'''<br><br>
1) Enter the following command to create a WIFI hotspot named '''orangepi ''' and password '''orangepi ''' in NAT mode<br>
{| class="wikitable" style="width:800px;"
|-
|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<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi5:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi'''<br>Config dir: /tmp/create_ap.wlan0.conf.fPItFUJ2 PID: 3831<br>Network Manager found, set ap0 as unmanaged device... DONE <br>Creating a virtual WiFi interface... ap0 created.<br>Sharing Internet using method: nat<br>hostapd command-line interface: hostapd_cli -p<br>
/tmp/create_ap.wlan0.conf.fPItFUJ2/hostapd_ctrl ap0: interface state UNINITIALIZED->ENABLED
|}
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<br><br>
[[Image:Pi-5-details-pic95.png]]<br><br>
4) After the connection is successful, the display is as shown in the figure below<br><br>
[[Image:Pi-5-details-pic96.png]]<br><br>
5) 在 In NAT 模式下,连接到开发板热点的无线设备是向开发板的 mode, the wireless device connected to the hotspot of the development board requests an IP address from the DHCP 服务请求 IP地址的,所以会有两个不同的网段,如这里开发板的 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<br>
{| class="wikitable" style="width:800px;"
|-
RX errors 0 dropped 50 overruns 0 frame 0<br>
TX packets 3798 bytes 1519493 (1.5 MB)<br>
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br>device interrupt 83
|}
[[Image:Pi-5-details-pic97.png]]<br><br>
[[Image:Pi-5-details-pic98.png]]<br><br>
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 参数指定接入点 AP 的网段为 parameter as 192.168.2.1<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi5:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1'''
|}
[[Image:Pi-5-details-pic99.png]]<br><br>
[[Image:Pi-5-details-pic100.png]]<br><br>
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<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5'''
|}
8) 如果需要隐藏 SSID,可以指定If you need to hide the SSID, you can specify the '''--hidden''' 参数,具体命令如下parameter, the specific command is as follows<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden'''
|}
[[Image:Pi-5-details-pic101.png]]<br><br>
'''2、create_ap 以 2.create_ap method to create WIFI hotspot in bridge 模式创建WIFI 热点的方法mode'''<br><br>1) 输入下面的命令以 bridge 模式创建名称为 Enter the following command to create a WIFI hotspot named '''orangepi'''、密码为 and password '''orangepi''' 的 WIFI热点in bridge mode<br>
{| class="wikitable" style="width:800px;"
|-
|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<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi'''<br>
[sudo] password for orangepi:<br>
Config dir: /tmp/create_ap.wlan0.conf.fg9U5Xgt <br>PID: 3141<br>Network Manager found, set ap0 as unmanaged device... DONE<br>Creating a virtual WiFi interface... ap0 created. <br>Sharing Internet using method: bridge<br>
Create a bridge interface... br0 created.<br>
hostapd command-line interface: hostapd_cli -p<br>
/tmp/create_ap.wlan0.conf.fg9U5Xgt/hostapd_ctrl <br>ap0: interface state UNINITIALIZED->ENABLED ap0: AP-ENABLED
|}
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<br><br>
[[Image:Pi-5-details-pic102.png]]<br><br>
4) 然后重启 linux 系统After the connection is successful, the display is as shown in the figure below<br><br>
[[Image:Pi-5-details-pic103.png]]<br><br>
5) 在 In bridge 模式下,连接到开发板热点的无线设备也是向主路由(开发板连接的路由器)的 mode, the wireless device connected to the hotspot of the development board also requests an IP address from the DHCP 服务请求 IP 地址的,如这里开发板的 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'''<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''ifconfig eth0'''<br>
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500<br>
inet '''<span style="color:#FF0000">192.168.1.150</span>''' netmask 255.255.255.0 broadcast 192.168.1.255 <br>inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link> <br>ether 4a:a0:c8:25:42:82 txqueuelen 1000 (Ethernet)<br>
RX packets 25370 bytes 2709590 (2.7 MB)<br>
RX errors 0 dropped 50 overruns 0 frame 0<br>
TX packets 3798 bytes 1519493 (1.5 MB)<br>
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0<br>device interrupt 83
|}
[[Image:Pi-5-details-pic104.png]]<br><br>
[[Image:Pi-5-details-pic105.png]]<br><br>
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<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --freq-band 5'''
|}
7) 如果需要隐藏 SSID,可以指定'''If you need to hide the SSID, you can specify the --hidden''' 参数,具体命令如下parameter, the specific command is as follows<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo create_ap -m bridge wlan0 eth0 orangepi orangepi --hidden'''
|}
[[Image:Pi-5-details-pic106.png]]<br><br>