widora 修改 IP 地址

35 篇文章 1 订阅
27 篇文章 2 订阅

1. 进入 目录 /etc/config#

发现文件network

dhcp           fstab          mountd         shairport      uhttpd
dropbear       luci           network        system         wireless
firewall       mjpg-streamer  rpcd           ucitrack

2. 修改network

vi network

修改 config interface ‘lan’

option  ipaddr ‘192.168.8.1’

改为 192.168.1.100

保存退出wq

 

3. 进入/etc/init.d

运行

/etc/init.d# ./network restart

显示

[ 1211.830000] br-lan: port 2(ra0) entered disabled state
[ 1211.840000] br-lan: port 1(eth0) entered disabled state
[ 1211.850000] device eth0 left promiscuous mode
[ 1211.850000] br-lan: port 1(eth0) entered disabled state
[ 1211.860000] IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
[ 1211.860000] device ra0 left promiscuous mode
[ 1211.870000] br-lan: port 2(ra0) entered disabled state
[ 1213.050000] rt305x-esw 10110000.esw: link changed 0x00
root@Widora:/etc/init.d# [ 1213.870000] device eth0 entered promiscuous mode
[ 1213.880000] br-lan: port 1(eth0) entered forwarding state
[ 1213.880000] br-lan: port 1(eth0) entered forwarding state
[ 1214.380000] device ra0 entered promiscuous mode
[ 1214.380000] br-lan: port 2(ra0) entered forwarding state
[ 1214.390000] br-lan: port 2(ra0) entered forwarding state
[ 1215.880000] br-lan: port 1(eth0) entered forwarding state
[ 1216.390000] br-lan: port 2(ra0) entered forwarding state
[ 1217.710000] rt305x-esw 10110000.esw: link changed 0x01

4. 查看IP地址

ifconfig

显示

br-lan    Link encap:Ethernet  HWaddr 0C:EF:AF:D1:DB:B5  
          inet addr:192.168.1.100  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fd60:1997:80d4::1/60 Scope:Global
          inet6 addr: fe80::eef:afff:fed1:dbb5/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:126 errors:0 dropped:0 overruns:0 frame:0
          TX packets:69 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:9652 (9.4 KiB)  TX bytes:11590 (11.3 KiB)

eth0      Link encap:Ethernet  HWaddr 0C:EF:AF:D1:DB:B4  
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:563 errors:0 dropped:0 overruns:0 frame:0
          TX packets:294 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:47008 (45.9 KiB)  TX bytes:50487 (49.3 KiB)
          Interrupt:5 

eth0.1    Link encap:Ethernet  HWaddr 0C:EF:AF:D1:DB:B4  
          inet6 addr: fe80::eef:afff:fed1:dbb4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:37 errors:0 dropped:0 overruns:0 frame:0
          TX packets:82 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1894 (1.8 KiB)  TX bytes:15949 (15.5 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:1968 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1968 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:134496 (131.3 KiB)  TX bytes:134496 (131.3 KiB)

ra0       Link encap:Ethernet  HWaddr 0C:EF:AF:D1:DB:B4  
          inet6 addr: fe80::eef:afff:fed1:dbb4/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:6 
说明已经修改了

 

当然你也可以直接修改

ifconfig br-lan 192.168.1.99 ,但没有保存,重新开机后会丢失

 

 

 

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值