- /etc/init.d/network reload
复制代码
7 g3 N- x+ V; d: V1 g7 q6 ] ]# y! d# G8 ^8 @( h0 W# x' m
- 1. 输入命令查看现有的网络接口配置信息% x- @: r8 w( C1 h k5 o
- uci show network
8 z% {$ K, M4 y
- V( w# |' y+ c- 2. 接口名称通常为`lan`,使用以下命令配置网络" A, g/ O" f6 x9 z" U M
- uci set network.lan.ipaddr=<固定IP地址>
6 l( ]! e. w7 P" l7 A! r - uci set network.lan.netmask=<子网掩码>) h) \. g! D% B; s$ {6 w; \
- uci set network.lan.gateway=<默认网关IP>
5 k0 ^1 h9 o. z- R+ Y - uci set network.lan.dns=<DNS服务器IP>" K4 r4 j! N! ?& o# @1 v; ^9 m
% e7 ?# _/ ^- H6 L% c) q6 Y- 3. 保存并应用新的配置
% q/ D/ m! ?* l% u* |4 m- l - uci commit network
0 Y6 t# G3 g9 M: r6 | - /etc/init.d/network restart
6 x% h# Z- D" m2 W2 c" i+ R$ U" L
- r* `. V0 J1 J4 E1 v- 4. 刷新网络接口,使新的配置生效
! q$ Y& n* e) T- L6 B - /etc/init.d/network reload* Z; [" a! V- j2 f/ ]) t- A
- ) ?; Q. p8 r8 B
- 5. 查看配置结果
4 t" P M3 H$ ~! \ - uci show network
& b1 B- w& g' _4 e - 或/ V( G# y8 P6 \
- ip addr
L& S& y, x3 D
复制代码
5 `9 o$ P" _) T2 u7 o3 c9 f3 W, k, }, `. @7 F
|