Open main menu

Wiki-Orange Pi β

Changes

Orange Pi CM4

240 bytes added, 16:33, 18 September 2023
Use the nmtui command to set a static IP address
<ol style="list-style-type: decimal;">
<li><p>First run the nmtui command</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''nmtui'''</p>|}</li>
<li><p>Then select '''Edit a connection''' and press Enter</p>
<p>[[File:cm4-img189.png]]</p></li>
<li><p>Then press Enter. After pressing Enter, the following setting interface will pop up.</p>
<p>[[File:cm4-img196.png]]</p></li>
<li><p>Then you can set the IP address (Addresses), gateway (Gateway) and DNS server address as shown in the figure below (there are many other setting options, please explore by yourself),'''<span style="color:#FF0000">Please set it according to your specific needs. The value set in the picture below is just an example.</span>'''</p>
<p>[[File:cm4-img197.png]]</p></li>
<li><p>After setting, move the cursor to '''&lt;OK&gt;''' in the lower right corner, and then press Enter to confirm.</p>
<p>[[File:cm4-img203.png]] [[File:cm4-img204.png]]</p></li>
<li><p>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</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
<p>3: eth0: &lt;BROADCAST,MULTICAST,UP,LOWER_UP&gt; mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
:<p>link/ether 5e:ac:14:a5:92:b3 brd ff:ff:ff:ff:ff:ff</p>:<p>inet '''<span style="color:#FF0000">192.168.1.177</span>'''/24 brd 192.168.1.255 scope global noprefixroute eth0</p>::<p>valid_lft forever preferred_lft forever</p>:<p>inet6 241e:3b8:3240:c3a0:e269:8305:dc08:135e/64 scope global dynamic noprefixroute</p>::<p>valid_lft 259149sec preferred_lft 172749sec</p>:<p>inet6 fe80::957d:bbbe:4928:3604/64 scope link noprefixroute</p>::<p>valid_lft forever preferred_lft forever</p>|}</li>
<li><p>Then you can test the network connectivity to check whether the IP address is configured OK. The ping command can be interrupted by using the '''Ctrl+C''' shortcut key.</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ping 192.168.1.47 -I eth0'''</p>
<p>PING 192.168.1.47 (192.168.1.47) from 192.168.1.188 eth0: 56(84) bytes of data.</p>
<p>--- 192.168.1.47 ping statistics ---</p>
<p>5 packets transmitted, 5 received, 0% packet loss, time 4042ms</p>
<p>rtt min/avg/max/mdev = 0.233/0.262/0.275/0.015 ms</p>|}</li></ol>
<span id="use-the-nmcli-command-to-set-a-static-ip-address"></span>
 
==== Use the nmcli command to set a static IP address ====