Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 5 detail

973 bytes added, 11:52, 23 April 2023
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
|}
而开发板的 By default, the DHCP 服务默认会给接入热点的设备分配 service of the development board will assign an IP address of '''192.168.12.0/24''' 的 IP 地址,这时点击已经连接的 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'''<br><br>
[[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'''
|}
此时通过手机连接到热点后,点击已经连接的 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'''<br><br>
[[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'''
|}
此时手机是搜索不到 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<br><br>
[[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
|}
而接入 The IP of the device connected to the WIFI 热点的设备的 IP 也是由主路由分配的,所以连接 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'''<br><br>
[[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'''
|}
此时手机是搜索不到 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.<br><br>
[[Image:Pi-5-details-pic106.png]]<br><br>