8,367
edits
Changes
→create_ap method to create WIFI hotspot in NAT mode
<ol style="list-style-type: decimal;">
<li><p>Enter the following command to create a WIFI hotspot named '''orangepi''' and password '''orangepi''' in NAT mode</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that in the following commands, Debian12 needs to change eth0 to end0.'''</p></li></olbig>|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
|}</li></ol>
<ol start="2" style="list-style-type: decimal;">
<li>If the following information is output, it means that the WIFI hotspot is created successfully</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --no-virt'''
wlan0: EAPOL-4WAY-HS-COMPLETED ce:bd:9a:dd:a5:86
|}</ol>
<ol start="3" style="list-style-type: decimal;">
<li>Take out the mobile phone at this time, 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, the password is set above '''orangepi'''</li></ol>
[[File:media/image119.png|230x183px]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>After the connection is successful, the display is as shown in the figure below</li></ol>
[[File:media/image120.png|233x111px]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li><p>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</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that in the following commands, Debian12 needs to change eth0 to end0.'''</p></li></olbig>|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo ifconfig eth0'''
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet '''<span style="color:#FF0000">192.168.1.150</span>''' netmask 255.255.255.0 broadcast 192.168.1.255
inet6 fe80::938f:8776:5783:afa2 prefixlen 64 scopeid 0x20<link>
device interrupt 83
|}
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'''
[[File:media/image121.png|274x155px]]
</li></ol>
<ol start="6" style="list-style-type: decimal;">
<li>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</li></ol>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Note that in the following commands, Debian12 needs to change eth0 to end0.'''</big>|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi -g 192.168.2.1 --no-virt'''
|}
At this time, after connecting to the hotspot through the mobile phone, click on the connected WIFI hotspot '''orangepi''', and then you can see that the IP address of the mobile phone is '''192.168.2.X'''.
[[File:media/image122.png|302x174px]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li><p>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</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that in the following commands, Debian12 needs to change eth0 to end0.'''</p></li></olbig>|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --freq-band 5 --no-virt'''
|}</li></ol>
<ol start="8" style="list-style-type: decimal;">
<li><p>If you need to hide the SSID, you can specify the '''--hidden''' parameter, the specific command is as follows</p>
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big><p>'''Note that in the following commands, Debian12 needs to change eth0 to end0.'''</p></li></olbig>|}
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''sudo create_ap -m nat wlan0 eth0 orangepi orangepi --hidden --no-virt'''
|}
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.
[[File:media/image123.png|237x198px]]
</li></ol>
<span id="create_ap-method-to-create-wifi-hotspot-in-bridge-mode"></span>
==== create_ap method to create WIFI hotspot in bridge mode ====