Openwrt 相关

配置IP地址

1
2
uci set network.wan.proto=dhcp
uci set network.lan.ipaddr=192.168.11.1

安装更新

  1. 下载升级包
1
2
3
cd /tmp
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/openwrt-ar71xx-generic-wzr-hp-g300nh-squashfs-sysupgrade.bin
wget http://downloads.openwrt.org/snapshots/trunk/ar71xx/md5sums
  1. 检测md5
1
md5sum -c md5sums
  1. 升级
1
sysupgrade -v /tmp/openwrt-ar71xx-generic-wzr-hp-g300nh-squashfs-sysupgrade.bin

安装软件

安装luci

  1. 安装luci-web
1
2
3
opkg update
opkg install luci
opkg install luci-theme-openwrt
  1. 配置端口
1
2
3
4
uci delete uhttpd.main.listen_http
uci commit
uci set uhttpd.main.listen_http=192.168.1.1:80
uci commit
  1. 重启httpd
1
/etc/init.d/uhttpd restart

安装USB挂载支持

1
2
opkg update
opkg install kmod-usb-storage block-mount kmod-fs-ext4 ntfs-3g

安装其他软件

1
2
opkg install transmission-web samba36-server minidlna nfs-kernel-server
opkg install openssh-sftp-server

升级所有包

1
opkg upgrade  $(opkg list-upgradable|awk '{print $1}')

tftp刷机[WZR-HP-G300NH]

在Ubuntu上

1
2
sudo ifconfig eth0 192.168.11.2 
sudo arp -s 192.168.11.1 02:AA:BB:CC:DD:20

拔掉路由电源、
在终端输入:

1
2
3
4
5
6
7
8
9
10
11
tftp 
tftp> verbose
提示Verbose mode on.
tftp> binary
提示 mode set to octet.
tftp> trace
提示 Packet tracing on.
tftp> rexmt 1
tftp> timeout 60
tftp> connect 192.168.11.1
tftp> put 1.bin