Open main menu

Wiki-Orange Pi β

Changes

Orange Pi 5 Plus

435 bytes added, 14:44, 7 June 2023
How to modify the IP address of the LAN port through the command line
# First use the following command to obtain the network configuration, the corresponding configuration file is '''/etc/config/network''', you can see that the value of '''network.lan.ipaddr''' is '''192.168.2.1'''
::{| class="wikitable" style="width:800px;"
|-
|
root@OpenWrt:~# '''uci show network'''
network.lan.proto='static'
'''<span style="color:#FF0000">network.lan.ipaddr='192.168.2.1'</span>'''
network.lan.netmask='255.255.255.0'
.…
|}
<ol start="3" style="list-style-type: decimal;">
<li>Then enter the following command to modify the item '''network.lan.ipaddr'''</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:~# '''uci set network.lan.ipaddr='192.168.100.1''''
|}</ol>
<ol start="4" style="list-style-type: decimal;">
<li>Then enter the following command to complete the submission, that is, write to the configuration file</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:~# '''uci commit'''
|}
If the IP address in red font is consistent with the one to be set, it means that the modification is successful
{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:~# '''cat /etc/config/network'''
config interface 'lan'
::option device 'br-lan'
::option proto 'static'
::option netmask '255.255.255.0'
::option ip6assign '60'
::'''<span style="color:#FF0000">option ipaddr '192.168.100.1'</span>'''
...
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>Restart the network through ubus, please refer to the official document for the usage instructions of ubus</li></ol>{| class="wikitable" style="width:800px;" |-|
root@OpenWrt:~# '''ubus call network restart'''
|}</ol>
<ol start="6" style="list-style-type: decimal;">
<li><p>At this point, enter the command and you can see that the IP of the LAN port is '''192.168.100.1'''</p>
{| class="wikitable" style="width:800px;"
|-
|
<p>root@OpenWrt:~# '''ifconfig br-lan'''</p>
<p>br-lan Link encap:Ethernet HWaddr FE:55:13:A3:EF:E7</p>
::<p>inet addr:'''<span style="color:#FF0000">192.168.100.1</span>''' Bcast:192.168.100.255 Mask:255.255.255.0</p>::<p>inet6 addr: fd60:c4cd:1033::1/60 Scope:Global</p>::<p>UP BROADCAST MULTICAST MTU:1500 Metric:1</p>::<p>RX packets:0 errors:0 dropped:0 overruns:0 frame:0</p>::<p>TX packets:3 errors:0 dropped:0 overruns:0 carrier:0</p>::<p>collisions:0 txqueuelen:1000</p>::<p>RX bytes:0 (0.0 B) TX bytes:370 (370.0 B)</p>|}</li></ol>
<span id="how-to-modify-the-root-password"></span>
 
== How to modify the root password ==