Code Monkey home page Code Monkey logo

Comments (32)

pbbqdd avatar pbbqdd commented on July 24, 2024 9

黑名单模式。手动改。
`etc\init.d\gw-redsocks文件
将36-40行

	[ "$mode" != "1" ] && {
		iptables -t nat -A $appname -m salist --salist china --match-dip -j RETURN
	}
	
    iptables -t nat -A $appname -p tcp -j DNAT --to-destination $lan_ip:$rs_port_tcp

改为

	[ "$mode" == "2" ] && {
		ipset -N gfwlist iphash
		iptables -t nat -A $appname -p tcp -m set --match-set gfwlist dst -j DNAT --to-destination $lan_ip:$rs_port_tcp
        }

	[ "$mode" == "1" ] && {

		iptables -t nat -A $appname -p tcp -j DNAT --to-destination $lan_ip:$rs_port_tcp
        }
	[ "$mode" == "0" ] && {

		iptables -t nat -A $appname -m salist --salist china --match-dip -j RETURN
		iptables -t nat -A $appname -p tcp -j DNAT --to-destination $lan_ip:$rs_port_tcp
	}

将/usr/lib/lua/luci/view/admin_web/prometheus/index.htm
130-131行

                        <option value="0">智能模式</option>
                        <option value="1">全局模式</option>

改为

                        <option value="0">智能模式</option>
                        <option value="1">全局模式</option>
			<option value="2">黑名单模式</option>

将/etc/gw-shadowsocks/gw-shadowsocks.dnslist
替换为
使用gfwlist2dnsmasq.sh命令生成的list
./gfwlist2dnsmasq.sh -p 53535 -s gfwlist -o gw-shadowsocks.dnslist

还有需要更新/etc/gw-redsocks/gw-shadowsocks/gw-shadowsocks.dnslist #37 (comment) 1.06没有这个文件了,可以省略此步骤

添加域名过滤按照gw-shadowsocks.dnslist 格式添加。
特殊ip过滤将ip加入/etc/ipset.d/gfwlist.ipset 文本下。无此文本新建即可。
目测使用良好,极4最新版本测试通过。
改好之后使用国外的ip地址查询网页测试一下,智能模式显示的是代理地址,黑名单模式显示国内地址,google可以正常访问。bt电驴流量走国内地址,防止代理被查。

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024 1

系统版本 : HC5962 - 1.3.5.18462s
当前版本 : hiwifi-ss v1.0.5

  • 我也发现代码问题,最终修改和你一样,代码一个是没有闭合还有就是你说的全局失效
  • 还有需要更新/etc/gw-redsocks/gw-shadowsocks/gw-shadowsocks.dnslist 否则黑名单模式失效

from hiwifi-ss.

dawnnao avatar dawnnao commented on July 24, 2024

非常希望作者增加黑名单模式:) @qiwihui

from hiwifi-ss.

dawnnao avatar dawnnao commented on July 24, 2024

from hiwifi-ss.

ikkyu0319 avatar ikkyu0319 commented on July 24, 2024

这块能否做成图形界面化一点,让码小白们,更容易点

from hiwifi-ss.

Smmyou avatar Smmyou commented on July 24, 2024

非常感谢作者的无私奉献,很期待黑名单模式,因为目前白名单有很多可以直联的站都走了SS,而且速度变慢。要走SS的站无非就那么几个,有了黑名单就可以自己灵活定制,很方便。黑名单功能希望也做成窗口化操作,像高级功能里的一样,可以直接输入网址,点保存即可。

from hiwifi-ss.

jndxhuxiehang avatar jndxhuxiehang commented on July 24, 2024

@dawnnao 请问如何手动更新gfwlist,第一次使用Linux,小白完全懵逼了如果方便,烦请告知更新的命令,谢谢

from hiwifi-ss.

xuepg avatar xuepg commented on July 24, 2024

请问白名单是哪个文件?可以手工修改吗?谢谢!

from hiwifi-ss.

naturezhm avatar naturezhm commented on July 24, 2024

非常希望增加黑名单模式

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024

@pbbqdd 太感谢,很详细,一看就会,一用就明白,你使用的极4版本号是?还有hiwifi-ss是1.5还是?再次感谢

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

@q629988171 HC5962 - 1.4.5.19222s ,ss是1.5的。写的行号可能和实际有出入,因为是基于git上的写的,不是1.5版,具体根据内容查找替换。原文etc\init.d\gw-redsocks的更改代后码有点错误,现已更新。否则使用全局模式时可能有点问题。

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

@q629988171 应该是这样。

from hiwifi-ss.

jndxhuxiehang avatar jndxhuxiehang commented on July 24, 2024

可以添加一个crond任务定期更新list

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024

@pbbqdd 特殊ip过滤将ip加入/etc/ipset.d/gfwlist.ipset 是不是说,如果这个IP要走SS就添加到/etc/ipset.d/gfwlist.ipset ,如果不是我该怎么做,因为我发现添加进去并没达到预期效果。谢谢

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

@q629988171 正常来说ip写在里面就走ss,不写就不走。查看是否加载了这个ipset使用
ipset list gfwlist |grep *.*.*.*
看一下那个IP是不是在这个列表里。可能需要重启路由一下。也可以手动添加
ipset add gfwlist *.*.*.*
这个功能我最近才用到,所以这块我没太仔细测试。但是如果加到表里肯定应该是好用的。

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024

@pbbqdd 重启生效 /etc/init.d/ipset restart,你有可能还需要重启SS /etc/init.d/gw-shadowsocks restart

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024

还有以下IP归属国内需要删除,影响黑名单模式 【迅雷远程下载 插件管理】无法访问:
ipset del gfwlist {
123.59.148.73
123.59.148.66
123.59.148.68
180.76.244.74
36.250.7.227
36.250.7.226
123.59.148.72
117.27.142.39
10.9.1.150
192.168.199.1
}

还有这个 gfwlist 里面的IP是不是会自动生成,因为我发现 123.59.148.72(北京市大兴区 天地祥云BGP数据中心) 我已经删除,后面再次查询又回来

国内IP走SS显然不合理,现在还不太明白怎么产生这个问题。

找到原因:dnsmasq解析该域名,发现该域名在gw-shadowsocks.dnslist中,使用设置的安全DNS服务器进行解析,并将该IP加至gfwlist集合中

from hiwifi-ss.

FengkuiChan avatar FengkuiChan commented on July 24, 2024

@pbbqdd 你好,按你分享的方法修改、添加黑名单模式后,发现黑名单模式连不上SS,路由器管理页面提示连接错误,智能模式和全局模式都能连上。请问最有可能是哪里出问题了?

from hiwifi-ss.

q629988171 avatar q629988171 commented on July 24, 2024

@FengkuiChan 检查是否更新/etc/gw-redsocks/gw-shadowsocks/gw-shadowsocks.dnslist

from hiwifi-ss.

FengkuiChan avatar FengkuiChan commented on July 24, 2024

@q629988171 两个地方都更新了

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

@FengkuiChan 在路由里使用ipset list gfwlist看一下是否有ip解析出来了。

from hiwifi-ss.

FengkuiChan avatar FengkuiChan commented on July 24, 2024

@pbbqdd 运行ipset list gfwlist后返回以下结果:
root@Hiwifi:# ipset list gfwlist
Name: gfwlist
Type: hash:ip
Revision: 4
Header: family inet hashsize 1024 maxelem 65536
Size in memory: 60
References: 1
Number of entries: 0
Members:
root@Hiwifi:
#

from hiwifi-ss.

voodoozz avatar voodoozz commented on July 24, 2024

@qiwihui pbbqdd
我也是跟fengkuichan一样的
黑名单模式无效, ipset list gfwlist出来的结果也一样

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

from hiwifi-ss.

voodoozz avatar voodoozz commented on July 24, 2024

@qiwihui
是的 两个地方我都更新了.
前面几行大概是:
server=/4tern.com/127.0.0.1#53535
server=/adorama.com/127.0.0.1#53535
server=/agnesb.fr/127.0.0.1#53535
server=/akiba-web.com/127.0.0.1#53535
server=/alien-ufos.com/127.0.0.1#53535
server=/altrec.com/127.0.0.1#53535
server=/arena.taipei/127.0.0.1#53535
server=/asianspiss.com/127.0.0.1#53535
server=/athenaeizou.com/127.0.0.1#53535

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

@voodoozz 更新后的大概格式应该是
server=/030buy.com/127.0.0.1#53535
ipset=/030buy.com/gfwlist


使用gfwlist2dnsmasq.sh命令生成的list
./gfwlist2dnsmasq.sh -p 53535 -s gfwlist -o gw-shadowsocks.dnslist
你确认是用gfwlist2dnsmasq重新生成的list么

from hiwifi-ss.

voodoozz avatar voodoozz commented on July 24, 2024

@qiwihui 抱歉...果然是生成的list不对, 我再重新试试
谢谢

from hiwifi-ss.

ReSur avatar ReSur commented on July 24, 2024

sh gfwlist2dnsmasq.sh -p 53535 -s gfwlist -o gw-shadowsocks.dnslist
-s gfwlist 参数是必须的,否则输出格式不一样,黑名单模式无效提示“连接错误”

from hiwifi-ss.

voodoozz avatar voodoozz commented on July 24, 2024

1.0.6下面黑名单模式不行了? 一直"连接错误", 其他两个模式都可以

from hiwifi-ss.

pbbqdd avatar pbbqdd commented on July 24, 2024

1.06黑名单/etc/gw-redsocks/gw-shadowsocks/gw-shadowsocks.dnslist这一步可以省略。其他不变。更新后list需要重新用命令生成。

from hiwifi-ss.

theosoft-git avatar theosoft-git commented on July 24, 2024

sh gfwlist2dnsmasq.sh -p 53535 -s gfwlist -o gw-shadowsocks.dnslist
我这边(B70)这样会出错,必须加上 --insecure,虽然直接浏览器访问没报ssh证书错误。
sh gfwlist2dnsmasq.sh --insecure -p 53535 -s gfwlist -o gw-shadowsocks.dnslist

from hiwifi-ss.

daliangdaliang avatar daliangdaliang commented on July 24, 2024

1.08 中默认一键安装后,黑名单说绕开本地ip,但是设置了mac和ip都没法绕开。等于还局域网内所有客户端都会使用hiwifi里面的ss

from hiwifi-ss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.