TP-Link TL-WR703N路由器刷打印服务,网络配置及补丁加载

  • Post author:
  • Post category:其他


网上关于Opwnwrt 的文章已经很多了,一些是时间比较久。折腾了2台703N路由器,其中一台搞成了砖头(误删文件,没有刷不死Bread)。第二台成功刷机。

整体刷机过程,这篇文件还是很详细的:


TP-LINK-TL-WR703N刷Breed用Openwrt固件挂MP288打印机服务共享手机打印服务_jinwei29的博客-CSDN博客_703n刷openwrt打印机


下面记录一些刷机的主要过程。

(刷Breed、刷固件、

配网络、装补丁、

加主题)

1、刷Breed(可选)。

2、刷固件。

下载地址,其他路由器可以在这里查询最新的固件

[OpenWrt Wiki] Table of Hardware: Firmware downloads

703N的固件如下(LEDE版本已经集成了luci web管理界面了,通过web界面就可以随意更换固件了)

https://downloads.openwrt.org/releases/17.01.7/targets/ar71xx/generic/lede-17.01.7-ar71xx-generic-tl-wr703n-v1-squashfs-factory.bin


https://downloads.openwrt.org/releases/17.01.7/targets/ar71xx/generic/lede-17.01.7-ar71xx-generic-tl-wr703n-v1-squashfs-sysupgrade.bin

3、设置网络,因703N只有一个网口,网络作为lan口使用,通过无线桥接链接上级路由器。


OpenWRT 网络配置WAN口和LAN口_mainn的博客-CSDN博客_openwrt 接口配置

a、/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'
##  下面2段是重点需要修改的。
config interface 'lan'
	option type 'bridge'
	option ifname 'eth0'
	option proto 'static'
	option netmask '255.255.255.0'
	option ipaddr '192.168.116.1'

config interface 'wwan'
	option proto 'dhcp'
	option delegate '0'

b、/etc/config/wireless配置

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/ar933x_wmac'
	option htmode 'HT20'
	option country 'CN'

#新增:桥接上级路由器
config wifi-iface 'up_radio0'
	option device 'radio0'
	option mode 'sta'
	option ssid '上级路由器热点名' #需要根据情况修改
	option encryption 'psk2'
	option key '上级路由器密码'  #需要根据情况修改
	option network 'wwan'

#开启703N热点
config wifi-iface 'lan_radio0'
	option device 'radio0'
	option mode 'ap'
	option ssid '703N热点名称'  #需要根据情况修改
	option encryption 'psk2'
	option key '703N热点密码'  #需要根据情况修改
	option network 'lan'

c、/etc/config/dhcp 配置

config interface 'loopback'
	option ifname 'lo'
	option proto 'static'

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/ar933x_wmac'
	option domainneeded '1'
	option boguspriv '1'
	option localise_queries '1'
	option rebind_protection '1'
	option rebind_localhost '1'
	option local '/lan/'
	option domain 'lan'
	option expandhosts '1'
	option authoritative '1'
	option readethers '1'
	option leasefile '/tmp/dhcp.leases'
	option resolvfile '/tmp/resolv.conf.auto'
	option localservice '1'
	option nonwildcard '0'

##无线及lan口dhcp服务。
config dhcp 'lan'
	option interface 'lan'
	option start '100'
	option limit '150'
	option leasetime '12h'

##
config dhcp 'wan'
	option interface 'wan'
	option ignore '1'

config odhcpd 'odhcpd'
	option maindhcp '0'
	option leasefile '/tmp/hosts/odhcpd'
	option leasetrigger '/usr/sbin/odhcpd-update'
config interface 'loopback'
	option ifname 'lo'
	option proto 'static'

config wifi-device 'radio0'
	option type 'mac80211'
	option channel '11'
	option hwmode '11g'
	option path 'platform/ar933x_wmac'
	option domainneeded '1'
	option boguspriv '1'
	option localise_queries '1'
	option rebind_protection '1'

config defaults
	option syn_flood '1'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'REJECT'

config zone
	option name 'lan'
	option input 'ACCEPT'
	option output 'ACCEPT'
	option forward 'ACCEPT'
	option network 'lan'

#开启wan口策略,这一段是需要调整的。
config zone
	option name 'wan'
	option output 'ACCEPT'
	option masq '1'
	option mtu_fix '1'
	option input 'ACCEPT'
	option forward 'ACCEPT'
	option network 'wwan'

config rule
	option name 'Allow-DHCP-Renew'
	option src 'wan'
	option proto 'udp'
	option dest_port '68'
	option target 'ACCEPT'
	option family 'ipv4'

config rule

在上级路由器为703N进行MAC绑定。通过lan口或wifi连接703N后,可以通过wan口地址或192.168.116.1进行路由器的管理。

其实可以通过web控制台进行配置。 参考资料:


OpenWrt路由器——基础网络配置_Irving.Gao的博客-CSDN博客_openwrt配置

4、安装打印服务等相关补丁。安装打印服务及中文包。

网络连通后,安装补丁。

opkg update
opkg install luci-i18n-base-zh-cn  
opkg install kmod-usb-printer
opkg install luci-app-p910nd
opkg install luci-i18n-p910nd-zh-cn

opkg install luci-proto-relay

其中luci-i18n-base-zh-cn为web管理界面汉化包,kmod-usb-printer、luci-app-p910nd、luci-i18n-p910nd-zh-cn打印服务相关,luci-proto-relay网络桥接相关。

经过简单配置就可以实现网络打印功能了。

5、安装主题(可选)。

主题地址:

https://github.com/apollo-ng/luci-theme-darkmatter

https://gitee.com/rosywrt/luci-theme-rosy

https://gitee.com/rosywrt/luci-theme-purple

主题手工安装对应的文件路径

luci-theme-XX/luasrc  ==>  /usr/lib/lua/luci

luci-theme-XX/htdocs ==> /www

luci-theme-XX/root  ==> /root

命令行应用主题:

##这是我比较喜欢的主题。
sh ./30_luci-theme-darkmatter



版权声明:本文为z3h原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。