8,367
edits
Changes
→Use the nmcli command to set a static IP address
<li><p>'''ipv4.addresses''' is followed by the static IP address to be set, which can be modified to the value you want to set</p></li>
<li><p>'''ipv4.gateway''' represents the address of the gateway</p>
{| class="wikitable" style="width:800px;" |-| <p>orangepi@orangepi:~$ '''sudo nmcli con mod "Wired connection 1" \<br /p><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="the-method-of-setting-the-linux-system-to-automatically-connect-to-the-network-for-the-first-time"></span>