配置openwrt 为sta模式
a) 关闭wan口, 只留出两个lan口
b) windows系统的pc有线直连盒子的lan口(注意)
配置安装环境
a) 安装usb
1) opkg update
2)opkg list-installed | grep usb
3)opkg install kmod-usb-core
4)opkg install kmod-usb-storage
b) 配置防火墙
1) 在/etc/config/firewall文件中 to accept packets on on TCP port 9100:
#Allow attached network printer
config 'rule'
option 'src' 'lan'
option 'proto' 'tcp'
option 'dest_port' '9100'
option 'target' 'ACCEPT'
2)opkg install kmod-usb-printer 或者 opkg install kmod-lp
参看:[添加链接描述](https://openwrt.org/docs/guide-user/storage/usb-installing)
c) 在/etc/hotplug.d/usb/20-printer文件中添加以下内容
#!/bin/sh
# Copyright (C) 2006 OpenWrt.org
if [ "$PRODUCT" = "4f9/27/100" ]
then
case "$ACTION" in
add)
/etc/init.d/p910nd stop
echo "`date`: Brother HL-2030 added" >> /tmp/hl-2030
/etc/init.d/p910nd start >> /tmp/hl-2030
echo "Done." >> /tmp/hl-2030
;;
remove)
echo "`date`: Brother HL-2030 removed" >> /tmp/hl-2030
/etc/init.d/p910nd stop >> /tmp/hl-2030
echo "Done." >> /tmp/hl-2030
;;
esac
fi
参看:https://openwrt.org/docs/guide-user/services/print_server/p910nd.server
开启p910nd Print Server
a) # opkg update
b) # opkg install kmod-usb-printer
c) # opkg install p910nd luci-app-p910nd
在windows上配置client 连接
参看:
https://openwrt.org/docs/guide-user/services/print_server/p910ndprinterserver