|
本帖最后由 99010 于 2020-3-6 22:48 编辑
不是旁路由,不是旁路由,不是旁路由,重要的事说三遍。
可以简单理解为,局域网内有一台可以无限制上网的电脑,而其他电脑有上网限制。其他电脑通过路由器连接那台无限制的电脑达到无限制上网的效果。
路由器使用openwrt官方固件,不需要很高配置,socks5几乎是明文传输,对cpu性能没啥要求,即使是老旧的ar9344系列mw4530、wdr4310、wndr4300都无压力。
假设,内网代理服务器是一台可运行v2、酸酸、乳酸菌饮料的设备,可以是电脑、N1、群晖、手机等(系统可以是Windows、Linux、安卓等)。
按照本方案,即使内网代理服务器关机也不会影响国内正常上网。
安装必要的组件
- opkg update
- opkg remove dnsmasq
- rm -rf /etc/config/dhcp
- opkg install dnsmasq-full ipset iptables-mod-nat-extra red---socks
复制代码 修改/etc/firewall.user,添加如下
- ipset -N gfwlist iphash
- iptables -t nat -A PREROUTING -p tcp -m set --match-set gfwlist dst -j REDIRECT --to-port 12345
复制代码 修改/etc/dnsmasq.conf,添加如下
创建/etc/dnsmasq.d/gfw.conf文件
- mkdir -p /etc/dnsmasq.d
- vi /etc/dnsmasq.d/gfw.conf
复制代码 内容如下(可自行添加或者找网上分享的gfwlist列表,注意一下格式。其中192.168.1.213是内网代理服务器的IP,改成你自己的)
- server=/google.com/192.168.1.213#5353
- ipset=/google.com/gfwlist
- server=/youtube.com/192.168.1.213#5353
- ipset=/youtube.com/gfwlist
- server=/twitter.com/192.168.1.213#5353
- ipset=/twitter.com/gfwlist
复制代码 配置red---socks
内容如下
- base {
- log_debug = off;
- log_info = off;
- log = "syslog:local7";
- daemon = on;
- redirector = iptables;
- }
- red---socks {
- local_ip = 0.0.0.0;
- local_port = 12345;
- ip = 192.168.1.213; //内网代理服务器的IP
- port = 1080; //内网代理服务器的端口
- type = socks5; //依据代理设备的运行模式,可选类型: socks4, socks5, http-connect, http-relay。其中http-connect更省资源
- }
- //Keep this line 保留这行
复制代码
到此,路由器端配置完成,重启一下。
内网代理服务器的v2配置文件参考如下
- {
- "inbounds":[
- { //socks5,用于代理
- "port":"1080",
- "protocol":"socks",
- "settings":{
- "auth":"noauth",
- "udp":true
- },
- "sniffing": {
- "enabled": true,
- "destOverride": ["http", "tls"]
- }
- },
- { //http模式
- "port":"1081",
- "protocol":"http",
- "settings":{},
- "sniffing": {
- "enabled": true,
- "destOverride": ["http", "tls"]
- }
- },
- { //任意门,备用dns解析
- "protocol": "dokodemo-door",
- "port": 5353,
- "settings": {
- "address": "8.8.8.8",
- "port": 53,
- "network": "udp",
- "timeout": 0
- }
- }
- ],
- "outbounds":[
- {
- "protocol":"vmess",
- "settings":{
- "vnext":[
- {
- "address":"1.1.1.1",
- "port":3333,
- "users":[
- {
- "id":"7e8bb2bc-958f-4ecd-ba03-8f1cdc4b3930",
- "alterId":64
- }
- ]
- }
- ]
- }
- }
- ]
- }
复制代码
|
评分
-
查看全部评分
|