8,367
edits
Changes
→Use the nmcli command to set a static IP address
<li><p>Then you can view the name of the network device through the '''nmcli con show''' command, as shown below</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''orangepi''' is the name of the WIFI network interface (the name > is not necessarily the same)</p></li>
<li><p>'''Wired connection 1''' is the name of the Ethernet interface</p>
</li>
<li><p>Then enter the following command,</p>
<ol style="list-style-type: lower-alpha;">
<li><p>'''"Wired connection 1"''' It means to set the static IP address > of the Ethernet port. If you need to set the static IP address > of WIFI, please modify it to the corresponding name of the > WIFI network interface (you can get it through the '''nmcli con > show''')</p></li><li><p>'''ipv4.addresses''' Behind is the static IP address to be set, > which can be modified to the value you want to set.</p></li>
<li><p>'''ipv4.gateway''' Indicates the address of the gateway</p>
<p>orangepi@orangepi:~$ '''nmcli con mod "Wired connection 1" \'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>'''ipv4.addresses "192.168.1.110" \'''</p>
<p>'''ipv4.gateway "192.168.1.1" \'''</p>
<p>'''ipv4.dns "8.8.8.8" \'''</p>
<p>'''ipv4.method "manual"'''</p>|}</li></ol>
</li>
<li><p>Then restart the Linux system</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo reboot'''</p>|}</li>
<li><p>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</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>orangepi@orangepi:~$ '''ip addr show eth0'''</p>
<p>3: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000</p>
:<p>link/ether 5e:ae:14:a5:91:b3 brd ff:ff:ff:ff:ff:ff</p>:<p>inet '''<span style="color:#FF0000">192.168.1.110</span>'''/32 brd 192.168.1.110 scope global noprefixroute eth0</p>::<p>valid_lft forever preferred_lft forever</p>:<p>inet6 240e:3b7:3240:c3a0:97de:1d01:b290:fe3a/64 scope global dynamic noprefixroute</p>::<p>valid_lft 259183sec preferred_lft 172783sec</p>:<p>inet6 fe80::3312:861a:a589:d3c/64 scope link noprefixroute</p>::<p>valid_lft forever preferred_lft forever</p>|}</li></ol>
<span id="ssh-remote-login-development-board"></span>