找回密码
 立即注册

QQ登录

只需一步,快速开始

搜索
广告投放联系QQ68610888
查看: 9603|回复: 6

原版TP-WR720(4Mflash)直接安装opwenwrt详细过程(非ttl)新手参考 老手飘过【转】

[复制链接]
发表于 2015-3-4 22:33 | 显示全部楼层 |阅读模式
本帖最后由 wiwjuk 于 2015-3-5 12:17 编辑

         最近想要弄个路由做中继,看中了720n的便携而且还是双网口(话说tp有出升级版820n了,300M的,不过貌似大了一点),便想入手一个。入手前搜索爬楼,却没有找到一篇关于原版720n刷op的详细过程……终于功夫不负有心人在其他地方找到,于是转帖在此,让后来人少走些弯路。本文以v3版本为例,op貌似原生不支持v4版本,但可通过改固件头的方式将v3版本的改为v4版本,具体改法请自行查找论坛,貌似某个地址的03改为04……

本文旨在给像我一样的小白提供思路,以及熟悉op的刷机及操作过程,方便以后的各种折腾。

感谢3楼的提醒,附上H大的帖子,里面有各种型号的uboot及相关操作的说明教程
H大帖子地址:https://www.right.com.cn/forum/thread-136444-1-1.html

向原文作者致敬(抱歉一个,转帖处貌似也是转的,不知道原作者是谁)

********************************************************************************************************************************


正文:
目录:
一、刷机
二、设置SSH登录
三、WAN/LAN网络设置
四、Wifi设置
五、支持USB
六、支持extroot
七、安装luci
八、安装samba
九、安装Transmission
十、DLNA
********************************************************************************************************************************
一、刷机
Openwrt针对每种路由器提供两个固件文件,factory.bin用于路由器原厂固件初次改刷为Openwrt使用,sysupgrade.bin用于从旧版本Openwrt升级到新版使用。
Openwrt基于WR720N的固件位于http://downloads.openwrt.org/snapshots/trunk/ar71xx/,固件文件:openw71xx-generic-tl-wr720n-v3-squashfs-factory.bin用于初次改刷,openwrt-ar71xx-generic-tl-wr720n-v3-squashfs-sysupgrade.bin在升级时使用。
TL-WR720N初次刷Openwrt方法:选择系统工具 -> 软件升级,在如下图中选择Openwrt固件文件,点击升级即可。
二、设置SSH登录
使用telent客户端登陆,初始IP地址为192.168.1.1
telnet 192.168.1.1
设置密码
root@OpenWrt:/# passwd
以后再登录就需要用ssh客户端了,我用putty(可自行搜索)
login as: root
root@192.168.1.1′s password:
BusyBox v1.19.4 (2013-11-23 22:58:54 UTC) built-in shell (ash)
Enter ‘help’ for a list of built-in commands.
_______                     ________        __
|       |.—–.—–.—–.|  |  |  |.—-.|  |_
|   -   ||  _  |  -__|     ||  |  |  ||   _||   _|
|_______||   __|_____|__|__||________||__|  |____|
|__| W I R E L E S S   F R E E D O M
—————————————————–
BARRIER BREAKER (Bleeding Edge, r38896)
—————————————————–
* 1/2 oz Galliano         Pour all ingredients into
* 4 oz cold Coffee        an irish coffee mug filled
* 1 1/2 oz Dark Rum       with crushed ice. Stir.
* 2 tsp. Creme de Cacao
—————————————————–
root@OpenWrt:~#
三、WAN/LAN网络设置
网络配置文件为/etc/config/network,修改参考如下(红色为修改行,蓝色为添加行):
root@OpenWrt:~# 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 ‘fd0f:5d48:301c::/48′

### LAN口设置修改,基本不用修改 ###
config interface ‘lan’
option ifname ‘eth1′
option type ‘bridge’
option proto ‘static’
option ipaddr ’192.169.1.1
option netmask ’255.255.255.0′
option ip6assign ’60′

### WAN口PPPoE ###
config interface ‘wan’
option ifname ‘eth0′
#####   option proto ‘dhcp’
option proto ‘pppoe’
option ‘username’  ’user’
option ‘password’ ‘password’

config interface ‘wan6′
option ifname ‘@wan’
option proto ‘dhcpv6′

四、Wifi设置
Wifi配置文件为/etc/config/wireless,下面是设置wifi名称为wr-ow,采用psk2认证方式、密码123456
root@OpenWrt:~# vi /etc/config/wireless
config wifi-device  radio0
option type     mac80211
option channel  11
option hwmode   11ng
option path     ‘platform/ar933x_wmac’
option htmode   HT20
list ht_capab   SHORT-GI-20
list ht_capab   SHORT-GI-40
list ht_capab   RX-STBC1
list ht_capab   DSSS_CCK-40
# REMOVE THIS LINE TO ENABLE WIFI:
#####   option disabled 1

config wifi-iface
option device   radio0
option network  lan
option mode     ap
option ssid    wr-ow
#####   option encryption none
option encryption psk2
option key 123456
五、支持USB
WR720有一个USB接口,可以接入USB存储设备。USB要先格式化Openwrt可识别分区我是在Ubuntu下面格式化为ext4分区格式的
先查询接入系统的USB硬盘,使用dmesg显示信息
[  242.090000] usb 1-1: new high-speed USB device number 2 using ehci-platform
说明是接口是USB2.0,需要kmod-usb2模块,固件缺省已安装

接下来只需安装kmod-usg-storage、kmod-fs-ext4内核模块,其他模块已缺省安装,执行:
root@OpenWrt:~# opkg install kmod-usb-storage
root@OpenWrt:~# opkg install kmod-fs-ext4
root@OpenWrt:~#reboot

启动后,查看是否已经支持:
root@OpenWrt:~# ls /dev/sda*
/dev/sda   /dev/sda1  /dev/sda2  /dev/sda3

六、支持extroot
WR720N只有4MB Flash存储,根分区放到flash上很小,没有空间安装多个软件;并且大部分软件缺省安装到根分区、安装到其他分区很困难,解决办法就是把根分区加载外部(usb)存储上。处理如下。
安装block-mount
root@OpenWrt:~# opkg update
root@OpenWrt:~# opkg install block-mount
root@OpenWrt:~# reboot

复制flash根分区文件到外部存储
root@OpenWrt:~# mkdir /mnt/sda1
root@OpenWrt:~# mount /dev/sda1 /mnt/sda1
root@OpenWrt:~# mkdir -p /tmp/cproot
root@OpenWrt:~# mount –bind / /tmp/cproot/
root@OpenWrt:/# tar -C /tmp/cproot/ -cvf – . | tar -C /mnt/sda1 -xf -
root@OpenWrt:/# umount /dev/sda1

修改fstab
root@OpenWrt:~# vi /etc/config/fstab
config ‘global’
option  anon_swap       ’0′
option  anon_mount   
option  auto_mount      ’1′   ’0′
option  auto_swap       ’1′
option  delay_root      ’5′
option  check_fs        ’0′

### USB硬盘的第一个分区用作根分区###
config ‘mount’
option  target  ‘/’
option  device /dev/sda1
option  fstype  ext4
option  options rw,sync
option  enabled ’1′
option  enabled_fsck 0

### USB硬盘的第二个分区用作交换分区 ###
config ‘swap’
option  device  ‘/dev/sda2′
option  enabled ’1′

### USB硬盘的第三个分区用作home分区 ###
config ‘mount’
option  target  ‘/home’
option  device  /dev/sda3
option  fstype  ext4
option  options rw,sync
option  enabled ’1′
option  enabled_fsck 0

七、安装luci除原文所写内容外,下面有更为详细的方法
******此处为原文方法*********************

root@OpenWrt:/# opkg update
root@OpenWrt:~# opkg install luci
root@OpenWrt:~# /etc/init.d/uhttpd enable
root@OpenWrt:~# /etc/init.d/uhttpd start
root@OpenWrt:~#

**********以下为更为详细的方法******************

刷OpenWRT标准版固件后安装LuCI的方法

一、与OpenWRT的路由器联机
用网线连接电脑的LAN口和路由器的LAN口,然后操作如下:
1.打开PuTTY,点树状列表中的“Session”项;
2.在Host Name (or IP address)文本框中输入“192.168.1.1”,在Port文本框中输入“22”;
3.在Connection type中选择“Telnet”,按下Open按钮,进入路由器的Linux终端,出现OpenWRT欢迎界面和root@OpenWRT:~#提示符;
注,以上可以使用Windows命令Telnet操作。
二、修改Root密码
1.在Linux终端中,输入“passwd root”,提示Changing password for root New passoword:的提示;
2.输入root用户的密码,输入过程没显示字符或掩码,输入完毕,回车,出现Retype password:的提示;
3.再一次输入root用户的密码,,输入过程没显示字符或掩码,输入完毕,回车,出现Password for root changed by root提示,表示更改root用户密码成功,为了安全,OpenWRT会把路由器的Telnet服务关闭,以后只能通过ssh协议和root用户密码登录路由器的Linux终端。
三、修改network配置连上互联网
再用一根网线,把路由器的WAN口与猫的Ethernet接口连接;
1.用WinSCP登陆路由器;
2.进入路由器的/etc/config目录,双击打开network文件;
3.修改“config interface 'wan'”项目为如下:

config interface 'wan'
option ifname 'eth1'
option _orig_ifname 'eth1'
option _orig_bridge 'false'
option proto 'pppoe'
option username '你的宽带账号'
option password '账号密码'

4.按Ctrl+S保存,或直接点保存图标,会再次出现提示窗口,按“否”按钮,显示上传提示;
5.再次打开network文件,确认修改成功;
6.按Ctrl+P打开PuTTY,登录路由器的Linux终端;
7.在提示符后输入“/etc/init.d/network restart”,等待一会,提示几行“'radio0' is disabled”等状态信息就表示重启完毕;
8.在提示符后输入“ping 8.8.8.8”,如果Ping通,表示已经成功接入互联网,按Ctrl+C可停止Ping操作;
  四、安装Web管理界面LuCY;
1.在打开PuTTY显示的路由器Linux终端中,输入“opkg update”,开始下载Packages.gz并更新;
2.输入“opkg install luci_trunk+svn9663-1_ar71xx.ipk”,安装LuCY主体,先开始自动下载各种关联库,下载完会自动安装配置,最后显示“Configuring luci.”;
3.输入“opkg install luci-i18n-chinese_trunk+svn9663-1_ar71xx.ipk”,安装LuCY简体中文语言;最后显示“Configuring luci-i18n-chinese.”;
4.输入“opkg install luci-theme-bootstrap_trunk+svn9663-1_ar71xx.ipk”,安装LuCY主题,最后显示“Configuring luci-theme-bootstrap.”;
5.输入“/etc/init.d/uhttpd enable”回车,打开uhttpd服务;
6.输入“/etc/init.d/uhttpd start”回车,让uhttpd自启动;
7.在电脑端的浏览器中输入“192.168.1.1”,可访问路由器就表示LuCY安装成功;
8.进入LuCY界面的System选项页;
9.点开Language and Style选项页;
10.在Language下接框中选择“chinese”,把语言改成中文;
11.在Design下下接框中选择“Bootstrap”,把主题改成Bootstrap;
12.按下“Save & Apply”,保存并应用;
13.按下“Logout”选项退出,即出现中文Bootstrap的登录界面。
五、其它要点
  在第四部分第2、3、4步可以先下载好这三个ipk包,用WinSCP放到路由器的/tmp目录,再用“cd /tmp”命令进入/tmp目录执行,这样可以避免连接错误。
    离线批量ipk安装方法
1.下载*.ipk插件包;
2.用WinSCP上传a.ipk、b.ipk、c.ipk到/tmp下;
3.用PuTTY执行:  


opkg update
cd /tmp
opkg install a b c


修改ipk包的软件源

/etc/opkg.conf文件记录着软件源,src/gz Packages后面地址就是软件源了,opk.conf文件代码如下:

#src/gz packages http://downloads.openwrt.org/snapshots/开发代码/版本/芯片/packages/
src/gz Packages ftp://a:a@192.168.1.100
dest root /                  
dest ram /tmp
lists_dir ext /var/opkg-lists
option overlay_root /overlay
dest plugin_root /plugin_root

  查看已安装的ipk:


opkg list-installed


删除已安装的ipk:


opkg remove xxxx.ipk


显示文件:


cat etc/config/network


编辑文件:


vim etc/config/network



八、安装samba
先查询当前可用的samba版本号和包名
root@OpenWrt:/# opkg update
root@OpenWrt:~# opkg list | grep  samba
luci-app-samba – svn-r9834-1 – Network Shares – Samba SMB/CIFS module
samba36-client – 3.6.11-2 – Samba 3.6 SMB/CIFS client
samba36-server – 3.6.11-2 – The Samba software suite is a collection of programs that implements the SMB protocol for UNIX systems, allowing you to serve files and printers to Windows, NT, OS/2 and DOS clients. This protocol is sometimes also referred to as the LanManager or Netbios protocol.

然后安装
root@OpenWrt:~# opkg install samba36-server
root@OpenWrt:~# opkg install luci-app-samba
root@OpenWrt:~# /etc/init.d/samba enable
root@OpenWrt:~# /etc/init.d/samba start
root@OpenWrt:~# reboot

配置过程如下:
先增加samba用户root
root@OpenWrt:~# smbpasswd -a root

可以使用luci通过Web进行配置(支持中文界面具体怎么弄忘记了,请自行搜索)

修改root用户可以访问samba,编辑template里面的invalid users = root为下图:

增加共享目录

九、安装Transmission

安装Transmission支持BT下载,以后再BT下载就不用开电脑了,省电。

root@OpenWrt:/# opkg update?

root@OpenWrt:~# opkg install transmission-daemon

root@OpenWrt:~# opkg install transmission-cli
root@OpenWrt:~# opkg install transmission-web
root@OpenWrt:~# opkg install transmission-remote
root@OpenWrt:~# /etc/init.d/transmission enable
root@OpenWrt:~# /etc/init.d/transmission start
root@OpenWrt:~#

配置如下:

root@OpenWrt: /# vi /etc/config/transmission

config transmission

        option enabled 1

        option config_dir '/home/trans'

        #option user 'nobody'

        option alt_speed_down 50

        option alt_speed_enabled false

        option alt_speed_time_begin  540

        option alt_speed_time_day 127

        option alt_speed_time_enabled false

        option alt_speed_time_end 1020

        option alt_speed_up 50

        option bind_address_ipv4 '0.0.0.0'

        option bind_address_ipv6 '::'

        option blocklist_enabled false

        option blocklist_url ''

        option cache_size_mb 2

        option dht_enabled true

        option download_dir '/home/trans/done'

        option download_queue_enabled true

        option download_queue_size 4

        option encryption 1

        option idle_seeding_limit 30

        option idle_seeding_limit_enabled false

        option incomplete_dir '/home/trans/incomplete'

        option incomplete_dir_enabled false

        option lazy_bitfield_enabled true

        option lpd_enabled false

        option message_level 1

        option peer_congestion_algorithm ''

        option peer_limit_global 240

        option peer_limit_per_torrent 60

        option peer_port 51413

        option peer_port_random_high 65535

        option peer_port_random_low 49152

        option peer_port_random_on_start false

        option peer_socket_tos 'default'

        option pex_enabled true

        option port_forwarding_enabled true

        option preallocation 1

        option prefetch_enabled true

        option queue_stalled_enabled true

        option queue_stalled_minutes 30

        option ratio_limit 2.0000

        option ratio_limit_enabled false

        option rename_partial_files true

        option rpc_authentication_required false

        option rpc_bind_address '0.0.0.0'

        option rpc_enabled true

        option rpc_password '12345678'

        option rpc_port 9091

        option rpc_url '/transmission/'

        option rpc_username 'zp'

        option rpc_whitelist '127.0.0.1,192.169.1.*'

        option rpc_whitelist_enabled true

        option scrape_paused_torrents_enabled true

        option script_torrent_done_enabled false

        option script_torrent_done_filename ''

        option seed_queue_enabled false

        option seed_queue_size 10

        option speed_limit_down 100

        option speed_limit_down_enabled false

        option speed_limit_up 20

        option speed_limit_up_enabled false

        option start_added_torrents true

        option trash_original_torrent_files false

        option umask 18

        option upload_slots_per_torrent 14

        option utp_enabled true

        option scrape_paused_torrents true

        option watch_dir_enabled false

        option watch_dir ''

root@OpenWrt:/ #

参考:  http://wiki.openwrt.org/doc/uci/transmission

十、DLNA

支持DLNA后,内容在网络上,就相当于云路由器了。

root@OpenWrt:/# opkg update

root@OpenWrt:/# opkg install minidlna

root@OpenWrt:/# /etc/init.d/minidlna enable

root@OpenWrt:/# /etc/init.d/minidlna start

配置如下:

root@OpenWrt:~# cat /etc/config/minidlna

config minidlna config

        option 'enabled' '1'

        option port '8200'

        option interface 'br-lan'

        option friendly_name 'OpenWrt DLNA Server'

        option db_dir '/home/dlna/run/minidlna'

        option log_dir '/var/log'

        option inotify '1'

        option enable_tivo '0'

        option strict_dlna '0'

        option presentation_url ''

        #option notify_interval '900'

        option notify_interval '60'

        option serial '12345678'

        option model_number '1'

        option root_container '.'

        list media_dir '/home/dlna'

        option album_art_names 'Cover.jpg/cover.jpg/AlbumArtSmall.jpg/albumartsmall.jpg/AlbumArt.jpg/albumart.jpg/Album.jpg/album.jpg/Folder.jpg/folder.jpg/Thumb.jpg/thumb.jpg'

root@OpenWrt:~#

当前Openwrt固件版本有个Bug,就是往DLNA目录下添加文件,不能自动更新。经验证可以用下面方法解决:

修改/etc/init.d/minidlna在minidlna启动时添加-R参数

start() {

       ……

        service_start /usr/bin/minidlna -R -f "$MINIDLNA_CONFIG_FILE"

}

参考http://wiki.openwrt.org/doc/uci/minidlna

<完>







本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?立即注册

×
我的恩山、我的无线 The best wifi forum is right here.
发表于 2015-3-4 22:38 | 显示全部楼层
楼主这教程倒是分的很细致啊!
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2015-3-5 00:44 | 显示全部楼层
灰常感谢卤煮分享的经验
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

 楼主| 发表于 2015-3-5 12:07 | 显示全部楼层
小茅 发表于 2015-3-5 00:32
这种方法有点OUT了,现在从OP官网下载的固件已经具有图形界面,没必要再这么麻烦了,另外现在最好先刷H大编 ...

感谢提醒
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2016-9-24 11:24 | 显示全部楼层
学习一下,弄一个来出差或当KMS用
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2024-1-18 22:40 | 显示全部楼层
近来使用720进来拜读,谢谢。
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

发表于 2024-1-21 00:00 | 显示全部楼层
720n V3 刷入openwrt-ar71xx-generic-tl-wr720n-v3-squashfs-factory.bin固件后,访问192.168.1.1失败

C:\Users\***>telnet 192.168.1.1
正在连接192.168.1.1...无法打开到主机的连接。 在端口 23: 连接失败

有遇到过吗,该怎么解决的?
我的恩山、我的无线 The best wifi forum is right here.
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

有疑问请添加管理员QQ86788181|手机版|小黑屋|Archiver|恩山无线论坛(常州市恩山计算机开发有限公司版权所有) ( 苏ICP备05084872号 )

GMT+8, 2024-4-19 13:45

Powered by Discuz! X3.5

© 2001-2024 Discuz! Team.

| 江苏省互联网有害信息举报中心 举报信箱:js12377 | @jischina.com.cn 举报电话:025-88802724 本站不良内容举报信箱:68610888@qq.com 举报电话:0519-86695797

快速回复 返回顶部 返回列表