1. 查看ip地址
root@JoshYueby:~# ifconfig
br-lan Link encap:Ethernet HWaddr 0C:EF:AF:D1:14:8F
inet addr:192.168.8.1 Bcast:192.168.8.255 Mask:255.255.255.0
inet6 addr: fddb:4a04:d1ab::1/60 Scope:Global
inet6 addr: fe80::eef:afff:fed1:148f/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:159 errors:0 dropped:0 overruns:0 frame:0
TX packets:80 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:28901 (28.2 KiB) TX bytes:12186 (11.9 KiB)
eth0 Link encap:Ethernet HWaddr 0C:EF:AF:D1:14:8E
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:304 errors:0 dropped:0 overruns:0 frame:0
TX packets:104 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:71537 (69.8 KiB) TX bytes:18036 (17.6 KiB)
Interrupt:5
eth0.1 Link encap:Ethernet HWaddr 0C:EF:AF:D1:14:8E
inet6 addr: fe80::eef:afff:fed1:148e/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:26 errors:0 dropped:0 overruns:0 frame:0
TX packets:29 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1672 (1.6 KiB) TX bytes:6332 (6.1 KiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:336 errors:0 dropped:0 overruns:0 frame:0
TX packets:336 errors:0 dropped:0 overruns:0 carrier:0
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:132 errors:0 dropped:0 overruns:0 frame:0
TX packets:132 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:13131 (13.1 KB) TX bytes:13131 (13.1 KB)
2. 打开 network ,命令 vi /etc/config/network
root@JoshYueby:~# vi /etc/config/network
config interface 'loopback'
option ifname 'lo'
option proto 'static'
option ipaddr '127.0.0.1'
option netmask '255.0.0.0'
config globals 'globals'
option ula_prefix 'fddb:4a04:d1ab::/48'
config interface 'lan'
option ifname 'eth0'
option force_link '1'
option macaddr '0c:ef:af:d1:14:8f'
option type 'bridge'
option proto 'static'
option ipaddr '192.168.8.1' //改为192.168.1.200
option netmask '255.255.255.0'
option ip6assign '60'
config switch
option name 'switch0'
option reset '1'
option enable_vlan '0'
3. 运行命令 /etc/init.d/network reload 使修改的ip地址生效
root@JoshYueby:/# /etc/init.d/network reload
4. 重新运行ifconfig,查看ip地址
root@Widora:/# ifconfig