OpenWrt使用privoxy修改UA
1.安装privoxy插件
- SSH连接到路由器
- 更新插件列表
update opkg

- 安装插件
opkg install privoxy luci-app-privoxy luci-i18n-privoxy-zh-cn
- 重启路由器
2.配置privoxy
- 打开配置页面

- 文件和目录

- 访问和控制

- 转发

- 杂项

- 日志

- 编辑配置
浏览器打开
http://config.privoxy.org/edit-actions-list?f=0


3.配置防火墙
- 打开防火墙

- 将规则添加到防火墙中
# 将局域网内的 HTTP 请求转发到 Privoxy 代理服务器上
iptables -t nat -N http_ua_drop
iptables -t nat -I PREROUTING -p tcp --dport 80 -j http_ua_drop
iptables -t nat -A http_ua_drop -m mark --mark 1/1 -j RETURN
iptables -t nat -A http_ua_drop -d 0.0.0.0/8 -j RETURN
iptables -t nat -A http_ua_drop -d 127.0.0.0/8 -j RETURN
iptables -t nat -A http_ua_drop -d 192.168.0.0/16 -j RETURN
iptables -t nat -A http_ua_drop -p tcp -j REDIRECT --to-port 8118

4…检测UA
www.all-tool.cn
如果UA是自定义的话则说明修改成功

参考文章
校园网共享上网检测机制的研究与解决方案(转载) - 真是古得


















![Connect to 127.0.0.1:1080 [/127.0.0.1] failed: Connection refused: connect](https://img-blog.csdnimg.cn/34cab1d6fa0f44ec9f57b141ea90bdfa.png)
