打开主菜单

Wiki-Orange Pi β

更改

Orange Pi 5 Plus

添加393字节, 2023年5月31日 (三) 16:58
通过命令行修改LAN口IP地址的方法
# 首先使用以下命令获取网络配置,对应的配置文件是'''/etc/config/network,'''可以看到'''network.lan.ipaddr'''这一项的值是'''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>然后输入以下命令修改'''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>然后输入以下命令完成提交,即写入到配置文件</li></ol>
{| class="wikitable" style="width:800px;"
|-
|
root@OpenWrt:~# '''uci commit'''
|}
如果红色字体的IP地址与要设置的一致,说明修改成功
{| class="wikitable" style="width:800px;"
|-
|
root@OpenWrt:~# '''cat /etc/config/network'''
option ip6assign '60'
'''<span style="color:#FF0000">option ipaddr '192.168.100.1'</span>'''
...
|}</ol>
<ol start="5" style="list-style-type: decimal;">
<li>通过ubus重启网络,ubus的使用说明请参考[https://openwrt.org/docs/guide-developer/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>此时,输入命令可以看到LAN口的IP已经是'''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:'''192.168.100.1''' 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>
== 修改root密码的方法 ==
8,460
个编辑