Changes

Jump to: navigation, search

Orange Pi 5 detail

439 bytes added, 16:02, 21 April 2023
查询 设置静态 IP 地址的方法
[[Image:Pi-5-details-pic71.png]]<br><br>
=== 查询 设置静态 How to set a static IP 地址的方法 address ===<br>'''1、使用nmtui 命令来设置静态IP 地址1.Use the nmtui command to set a static IP address'''<br><br>1) 首先运行 '''First run the nmtui''' 命令command<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''nmtui'''
|}
2) 然后选择 Then select '''Edit a connection''' 并按下回车键and press Enter<br><br>
[[Image:Pi-5-details-pic72.png]]<br><br>
3) 然后选择需要设置静态 Then select the network interface that needs to set a static IP 地址的网络接口,比如设置 address, for example, to set the static IP address of the '''Ethernet''' 接口的静态 IP 地址选择 interface, select '''Wired connection 1''' 就可以了<br><br>
[[Image:Pi-5-details-pic73.png]]<br><br>
4) 然后通过 Then select '''TabEdit''' 键选择 via the '''EditTab''' 并按下回车键key and press the Enter key<br><br>
[[Image:Pi-5-details-pic74.png]]<br><br>
5) 然后通过 Then use the Tab 键将光标移动到下图所示的key to move the cursor to the '''<Automatic>'''位置进行 position shown in the figure below to configure IPv4 的配置<br><br>
[[Image:Pi-5-details-pic75.png]]<br><br>
6) 然后回车,通过上下方向键选择 Then press Enter, select '''Manual''',然后回车确定through the up and down arrow keys, and press Enter to confirm<br><br>
[[Image:Pi-5-details-pic76.png]]<br><br>
7) 选择完后的显示如下图所示The display after selection is shown in the figure below<br><br>
[[Image:Pi-5-details-pic77.png]]<br><br>
8) 然后通过 Tab 键将光标移动到Then move the cursor to '''<Show>'''via the Tab key<br><br>
[[Image:Pi-5-details-pic78.png]]<br><br>
9) 然后回车,回车后会弹出下面的设置界面Then press Enter, and the following setting interface will pop up after entering<br><br>
[[Image:Pi-5-details-pic79.png]]<br><br>
10) 然后就可以在下图所示的位置设置 Then you can set the IP 地址address (Addresses)、网关, gateway (Gateway)and DNS 服务器的地址(里面还有很多其他设置选项,请自行探索),server address in the position shown in the figure below (there are many other setting options in it, '''<span style="color:#FF0000">请根据自己的具体需求来设置,下图中设置的值只是一个示例please explore by yourself),Please set it according to your specific needs, the value set in the figure below is just an example</span>'''<br><br>
[[Image:Pi-5-details-pic80.png]]<br><br>
11) 设置完后将光标移动到右下角的After setting, move the cursor to '''<OK>''',然后回车确认in the lower right corner, and press Enter to confirm<br><br>
[[Image:Pi-5-details-pic81.png]]<br><br>
12) 然后点击Then click '''<Back>'''回退到上一级选择界面to return to the previous selection interface<br><br>
[[Image:Pi-5-details-pic82.png]]<br><br>
13) 然后选择 Then select '''Activate a connection''',再将光标移动到, then move the cursor to '''<OK>''',最后点击回车, and finally click Enter<br><br>
[[Image:Pi-5-details-pic83.png]]<br><br>
14) 然后选择需要设置的网络接口,比如 Then select the network interface that needs to be set, such as '''Wired connection 1''',然后将光标移动到 , then move the cursor to '''<Deactivate>''',再按下回车键禁用 , and press Enter to disable '''Wired connection 1'''<br><br>
[[Image:Pi-5-details-pic84.png]]<br><br>
15) 然后请不要移动光标,再按下回车键重新使能 Then please do not move the cursor, and then press the Enter key to re-enable '''Wired connection 1''',这样前面设置的静态 , so that the static IP 地址就会生效了address set earlier will take effect<br><br>
[[Image:Pi-5-details-pic85.png]]<br><br>
16) 然后通过Then you can exit nmtui through the '''<Back>'''and '''Quit''' 按钮就可以退出 nmtuibuttons<br><br>
[[Image:Pi-5-details-pic86.png]][[Image:Pi-5-details-pic86-1.png]]<br><br>
17) 然后通过Then through '''ip addr show eth0''' 就能看到网口的IP 地址已经变成前面设置的静态IP地址了, you can see that the IP address of the network port has changed to the static IP address set earlier<br>
{| class="wikitable" style="width:800px;"
|-
inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute<br>
valid_lft 259149sec preferred_lft 172749sec<br>
inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroutevalid_lft forever preferred_lft forever
|}
18) 然后就可以测试网络的连通性来检查 Then you can test the connectivity of the network to check whether the IP 地址是否配置 address is configured OK 了,, and the '''ping''' 命令可以通过 command can be interrupted through the shortcut key '''Ctrl+C''' 快捷键来中断运行<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''ping 192.168.1.47 -I eth0'''<br>
PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.<br>
64 bytes from 192.168.1.47: icmp_seq=1 ttl=64 time=0.233 ms <br>64 bytes from 192.168.1.47: icmp_seq=2 ttl=64 time=0.263 ms <br>64 bytes from 192.168.1.47: icmp_seq=3 ttl=64 time=0.273 ms <br>64 bytes from 192.168.1.47: icmp_seq=4 ttl=64 time=0.269 ms <br>64 bytes from 192.168.1.47: icmp_seq=5 ttl=64 time=0.275 ms <br>--- 192.168.1.47 ping statistics ---<br>5 packets transmitted, 5 received, 0% packet loss, time 4042ms <br>rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms
|}
<br>'''2、使用nmcli 命令来设置静态IP 地址2.Use the nmcli command to set a static IP address'''<br><br>1) 如果要设置网口的静态 If you want to set the static IP 地址,请先将网线插入开发板,如果需要设置 address of the network port, please insert the network cable into the development board first. '''If you need to set the static IP address of WIFI'''的静态 '''IP''' 地址,请先连接好 ''', please connect the WIFIfirst''',然后再开始设置静态 , and then start to set the static IP 地址address<br><br>2) 然后通过 Then you can view the name of the network device through the '''nmcli con show''' 命令可以查看网络设备的名字,如下所示command, as shown below<br>a. '''orangepi''' is the name of the WIFI 网络接口的名字(名字不一定相同)network interface (the name is not necessarily the same)<br>b. '''Wired connection 1''' 为以太网接口的名字is the name of the Ethernet interface<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''nmcli con show'''
|}
{| class="wikitable" style="width:800px;border: none !important;"
| '''Wired connection 1''' || 9db058b7-7701-37b8-9411-efc2ae8bfa30 || ethernet || eth0
|}
3) 然后输入下面的命令,其中Then enter the following command, where<br>a. '''"Wired connection 1"''' 表示设置以太网口的静态 means to set the static IP 地址,如果需要设置WIFI 的静态 address of the Ethernet port. If you need to set the static IP 地址,请修改为 address of the WIFI 网络接口对应的名字(通过 , please modify it to the corresponding name of the WIFI network interface (you can get it through the '''nmcli con show''' 命令可以获取到)command)<br>b. '''ipv4.addresses''' 后面是要设置的静态 is followed by the static IP 地址,可以修改为自己想要设置的值address to be set, which can be modified to the value you want to set<br>c. '''ipv4.gateway''' 表示网关的地址represents the address of the gateway<br>
{| class="wikitable" style="width:800px;"
|-
|'''orangepi@orangepi:~$ '''nmcli con mod "Wired connection 1" \'''<br>
'''ipv4.addresses "192.168.1.110" \'''<br>
'''ipv4.gateway "192.168.1.1" \'''<br>
'''ipv4.method "manual"'''
|}
4) 然后重启 Then restart the linux 系统system<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo reboot'''
|}
5) 然后重新进入linux 系统使用 Then re-enter the linux system and use the '''ip addr show eth0''' 命令就可以看到IP 地址已经设置为想要的值了command to see that the IP address has been set to the desired value<br>
{| class="wikitable" style="width:800px;"
|-
inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic noprefixroute<br>
valid_lft 259183sec preferred_lft 172783sec<br>
inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute valid_lft forever preferred_lft forever
|}

Navigation menu