Openwrt常用命令

AR系列分区地址

4M flash的分区地址:
分区名        起始地址        结束地址         分区长度 
uboot        0x9f000000         0x9f020000         0x20000 
firmware     0x9f020000         0x9f3e0000         0x3c0000
art          0x9f3f0000         0x9f3e0000         0x10000

8M flash的分区地址:
分区名        起始地址        结束地址         分区长度 
uboot        0x9f000000         0x9f020000         0x20000 
firmware     0x9f020000         0x9f7e0000         0x7c0000
art          0x9f7f0000         0x9f7e0000         0x10000


1.命令行刷系统

固件传至/tmp

1
2
3
4
5
6
7
8
9
cd /tmp
cat /proc/mtd
dev: size erasesize name
mtd0:  00020000  00010000  “u-boot”
mtd1: 000e01c4  00010000  “kernel”
mtd2: 002efe3c  00010000  “rootfs”
mtd3:  00060000  00010000  “rootfs_data”
mtd4:  00010000  00010000  “art”
mtd5: 003d0000  00010000  “firmware”

从上面的命令可以得知,mtd5是 firmare

#使用mtd更新系统

1
mtd -r write factory.bin firmware

#使用sysupgrade更新系统,推荐。

1
sysupgrade factory.bin


2.ttl刷新编程器固件、fw、uboot、art

4M的:

刷编程器固件:

1
2
3
tftp  0x80000000  full.bin
erase  0x9f000000  + 0x400000
cp.b  0x80000000  0x9f000000  0x400000

刷uboot:

1
2
3
tftp  0x80000000  uboot.bin
erase  0x9f000000  + 0x20000
cp.b  0x80000000  0x9f000000  0x20000

刷fw:

1
2
3
tftp  0x80000000  fw.bin
erase  0x9f020000  + 0x3c0000
cp.b  0x80000000  0x9f020000  0x3c0000

刷art:

1
2
3
tftp  0x80000000  art.bin
erase  0x9f3f0000  + 0x10000
cp.b  0x80000000  0x9f3f0000  0x10000


8M的:

刷编程器固件:

1
2
3
tftp  0x80000000  full.bin
erase  0x9f000000  + 0x800000
cp.b  0x80000000  0x9f000000  0x800000

刷uboot:

1
2
3
tftp  0x80000000  uboot.bin
erase  0x9f000000  + 0x20000
cp.b  0x80000000  0x9f000000  0x20000

刷fw:

1
2
3
tftp  0x80000000  fw.bin
erase  0x9f020000  + 0x7c0000
cp.b  0x80000000  0x9f020000  0x7c0000

刷art:

1
2
3
tftp  0x80000000  art.bin
erase  0x9f7f0000  + 0x10000
cp.b  0x80000000  0x9f7f0000  0x10000

3.更新官方固件后命令行安装luci

下列命令适用于ppoe上网方式

1
2
3
4
5
uci  set  network.wan.proto=pppoe
uci  set  network.wan.username= 'secret'
uci  set  network.wan.password= 'secret'
uci commit network
ifup wan

检查连接和dns是否正常

1
ping -c  1  8.8 . 8.8
1
ping -c  1  google.com

如果连接没问题进行下列步骤

1
2
3
4
opkg update
opkg install luci
/etc/init.d/uhttpd enable
/etc/init.d/uhttpd start

然后应该就可以打开 http://192.168.1.1/ 登陆了

  • 1
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值