8,367
edits
Changes
Created page with "<br>'''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:~$ '''..."
<br>'''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''' interface, select '''Wired connection 1'''<br><br>
[[Image:Pi-5-details-pic73.png]]<br><br>
4) Then select '''Edit''' via the '''Tab''' 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) 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''' buttons<br><br>
[[Image:Pi-5-details-pic86.png]][[Image:Pi-5-details-pic86-1.png]]<br><br>
17) Then through '''ip addr show eth0''', 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;"
|-
|orangepi@orangepi:~$ '''ip addr show eth0'''<br>
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br>
link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff<br>
inet '''<span style="color:#FF0000">192.168.1.177</span>'''/24 brd 192.168.1.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever<br>
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 noprefixroute valid_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>'''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, please connect the WIFI first''', 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;"
|-
| NAME || UUID || TYPE || DEVICE
|-
| '''orangepi'''|| cfc4f922-ae48-46f1-84e1-2f19e9ec5e2a || wifi || wlan0
|-
| '''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 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.dns "8.8.8.8" \''' <br>
'''ipv4.method "manual"'''
|}
4) Then restart the linux system<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo reboot'''
|}
5) Then re-enter the linux system and use the '''ip addr show eth0''' command to see that the IP address has been set to the desired value<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''ip addr show eth0'''<br>
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br>
link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff<br>
inet '''<span style="color:#FF0000">192.168.1.110</span>'''/32 brd 192.168.1.110 scope global noprefixroute eth0 valid_lft forever preferred_lft forever<br>
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
|}
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''' interface, select '''Wired connection 1'''<br><br>
[[Image:Pi-5-details-pic73.png]]<br><br>
4) Then select '''Edit''' via the '''Tab''' 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) 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''' buttons<br><br>
[[Image:Pi-5-details-pic86.png]][[Image:Pi-5-details-pic86-1.png]]<br><br>
17) Then through '''ip addr show eth0''', 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;"
|-
|orangepi@orangepi:~$ '''ip addr show eth0'''<br>
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br>
link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff<br>
inet '''<span style="color:#FF0000">192.168.1.177</span>'''/24 brd 192.168.1.255 scope global noprefixroute eth0 valid_lft forever preferred_lft forever<br>
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 noprefixroute valid_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>'''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, please connect the WIFI first''', 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;"
|-
| NAME || UUID || TYPE || DEVICE
|-
| '''orangepi'''|| cfc4f922-ae48-46f1-84e1-2f19e9ec5e2a || wifi || wlan0
|-
| '''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 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.dns "8.8.8.8" \''' <br>
'''ipv4.method "manual"'''
|}
4) Then restart the linux system<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''sudo reboot'''
|}
5) Then re-enter the linux system and use the '''ip addr show eth0''' command to see that the IP address has been set to the desired value<br>
{| class="wikitable" style="width:800px;"
|-
|orangepi@orangepi:~$ '''ip addr show eth0'''<br>
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000<br>
link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff<br>
inet '''<span style="color:#FF0000">192.168.1.110</span>'''/32 brd 192.168.1.110 scope global noprefixroute eth0 valid_lft forever preferred_lft forever<br>
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
|}