8,367
edits
Changes
→How to set a static IP address
=== How to set a static IP address ===
{| class="wikitable" style="background-color:#ffffdc;width:800px;" |-| <big>'''Please do not set a static IP address by modifying the /etc/network/interfaces configuration file.'''</big>|}
<span id="use-the-nmtui-command-to-set-a-static-ip-address"></span>
# First run the '''nmtui''' command
::{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''nmtui'''
|}
<ol start="2" style="list-style-type: decimal;">
<li>Then select '''Edit a connection''' and press Enter</li></ol>
[[File:pi3b-img188.png]]
</ol>
<ol start="3" style="list-style-type: decimal;">
<li>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'''.</li></ol>
[[File:pi3b-img189.png]]
</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then select '''Edit''' with the '''Tab''' key and press the Enter key</li></ol>
[[File:pi3b-img190.png]]
</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Then use the Tab key to move the cursor to the '''<Automatic>''' position shown in the figure below to configure IPv4</li></ol>
[[File:pi3b-img191.png]]
</ol>
<ol start="6" style="list-style-type: decimal;">
<li>Then press Enter, select '''Manual''' with the up and down arrow keys, and press Enter to confirm</li></ol>
[[File:pi3b-img192.png]]
</ol>
<ol start="7" style="list-style-type: decimal;">
<li>The display after selection is shown in the figure below</li></ol>
[[File:pi3b-img193.png]]
</ol>
<ol start="8" style="list-style-type: decimal;">
<li>Then move the cursor to the '''<Show>'''</li></ol>
[[File:pi3b-img194.png]]
</ol>
<ol start="9" style="list-style-type: decimal;">
<li>Then press Enter, the following setting interface will pop up after entering</li></ol>
[[File:pi3b-img195.png]]
</ol>
<ol start="10" style="list-style-type: decimal;">
<li>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, please explore by yourself),'''<span style="color:#FF0000">Please set it according to your specific needs, the value set in the figure below is just an example</span>'''</li></ol>
[[File:pi3b-img196.png]]
</ol>
<ol start="11" style="list-style-type: decimal;">
<li>After setting, move the cursor to'''<OK>''' in the lower right corner, and press Enter to confirm</li></ol>
[[File:pi3b-img197.png]]
</ol>
<ol start="12" style="list-style-type: decimal;">
<li>Then click'''<Back>''' to return to the previous selection interface</li></ol>
[[File:pi3b-img198.png]]
</ol>
<ol start="13" style="list-style-type: decimal;">
<li>Then select '''Activate a connection''', then move the cursor to'''<OK>''', and finally click Enter</li></ol>
[[File:pi3b-img199.png]]
</ol>
<ol start="14" style="list-style-type: decimal;">
<li>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'''</li></ol>
[[File:pi3b-img200.png]]
</ol>
<ol start="15" style="list-style-type: decimal;">
<li>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</li></ol>
[[File:pi3b-img201.png]]
</ol>
<ol start="16" style="list-style-type: decimal;">
<li>Then you can exit nmtui through the'''<Back>''' and '''Quit''' buttons</li></ol>
[[File:pi3b-img202.png]] [[File:pi3b-img203.png]]
</ol>
<ol start="17" style="list-style-type: decimal;">
<li>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</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''ip addr show eth0'''
3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
:link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff
: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
:inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute
::valid_lft 259149sec preferred_lft 172749sec
:inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute valid_lft forever preferred_lft forever
::valid_lft forever preferred_lft forever
|}
</ol>
<ol start="18" style="list-style-type: decimal;">
<li>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'''</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
orangepi@orangepi:~$ '''ping 192.168.1.47 -I eth0'''
rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms
|}</ol>
<span id="use-the-nmcli-command-to-set-a-static-ip-address"></span>
==== Use the nmcli command to set a static IP address ====
<span id="ssh-remote-login-development-board"></span>
== SSH remote login development board ==