Skip to content

Commit

Permalink
v1.6.14b
Browse files Browse the repository at this point in the history
~增加节点绕过功能
~增加nftables依赖检测及自动安装功能(限OpenWrt)
~优化配置文件生成逻辑
…………
~增加CN-IPV6绕过内核功能(#294)
~修复节点绕过bug
~pre核redirhost模式强制启用域名嗅探
~新手引导部分优化
~在线生成配置下载优化
  • Loading branch information
juewuy committed Jan 1, 2023
1 parent 39c93ef commit 08cc386
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 12 deletions.
2 changes: 1 addition & 1 deletion scripts/clash.sh
Original file line number Diff line number Diff line change
Expand Up @@ -521,7 +521,7 @@ setipv6(){
echo -e " 1 ipv6内核支持: \033[36m$ipv6_support\033[0m ——用于ipv6节点及规则支持"
echo -e " 2 ipv6透明代理: \033[36m$ipv6_redir\033[0m ——代理ipv6流量"
echo -e " 3 ipv6-DNS解析: \033[36m$ipv6_dns\033[0m ——决定内置DNS是否返回ipv6地址"
echo -e " 4 CN-ipv6绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能,不兼容fake-ip"
echo -e " 4 CNIP绕过内核: \033[36m$cn_ipv6_route\033[0m ——优化性能,不兼容fake-ip"
echo -----------------------------------------------
read -p "请输入对应数字 > " num
case $num in
Expand Down
15 changes: 13 additions & 2 deletions scripts/getdate.sh
Original file line number Diff line number Diff line change
Expand Up @@ -558,9 +558,10 @@ setgeo(){
echo -----------------------------------------------
echo -e " 1 由\033[32malecthw\033[0m提供的全球版GeoIP数据库(约6mb)"
echo -e " 2 由\033[32mHackl0us\033[0m提供的精简版CN-IP数据库(约0.2mb)"
echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过内核功能,约0.2mb)"
echo -e " 3 由\033[32m17mon\033[0m提供的CN-IP文件(需启用CN_IP绕过,约0.2mb)"
echo -e " 4 由\033[32mChanthMiao\033[0m提供的CN-IPV6文件(需ipv6启用CN_IP绕过,约50kb)"
[ "$clashcore" = "clash.meta" ] && \
echo -e " 4 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)"
echo -e " 5 由\033[32mLoyalsoldier\033[0m提供的GeoSite数据库(限Meta内核,约4.5mb)"
echo " 0 返回上级菜单"
echo -----------------------------------------------
read -p "请输入对应数字 > " num
Expand All @@ -583,6 +584,16 @@ setgeo(){
sleep 1
fi
elif [ "$num" = '4' ]; then
if [ "$cn_ipv6_route" = "已开启" -a "$ipv6_redir" = "已开启" ]; then
geotype=china_ipv6_list.txt
geoname=cn_ipv6.txt
getgeo
else
echo -----------------------------------------------
echo -e "\033[31m未开启ipv6下CN绕过功能,无需更新CN-IPV6文件!!\033[0m"
sleep 1
fi
elif [ "$num" = '5' ]; then
geotype=geosite.dat
geoname=geosite.dat
getgeo
Expand Down
18 changes: 9 additions & 9 deletions scripts/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -456,19 +456,19 @@ cn_ip_route(){
}
}
cn_ipv6_route(){
[ ! -f $bindir/china_ipv6_list.txt ] && {
if [ -f $clashdir/china_ipv6_list.txt ];then
mv $clashdir/china_ipv6_list.txt $bindir/china_ipv6_list.txt
[ ! -f $bindir/cn_ipv6.txt ] && {
if [ -f $clashdir/cn_ipv6.txt ];then
mv $clashdir/cn_ipv6.txt $bindir/cn_ipv6.txt
else
logger "未找到cn_ipv6列表,正在下载!" 33
$0 webget $bindir/china_ipv6_list.txt "$update_url/bin/china_ipv6_list.txt"
[ "$?" = "1" ] && rm -rf $bindir/china_ipv6_list.txt && logger "列表下载失败!" 31
$0 webget $bindir/cn_ipv6.txt "$update_url/bin/china_ipv6_list.txt"
[ "$?" = "1" ] && rm -rf $bindir/cn_ipv6.txt && logger "列表下载失败!" 31
fi
}
[ -f $bindir/china_ipv6_list.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && {
[ -f $bindir/cn_ipv6.txt -a -z "$(echo $redir_mod|grep 'Nft')" ] && {
#ipv6
echo "create cn_ip6 hash:net family inet6 hashsize 1024 maxelem 65536" > /tmp/cn6_$USER.ipset
awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' $bindir/china_ipv6_list.txt >> /tmp/cn6_$USER.ipset
awk '!/^$/&&!/^#/{printf("add cn_ip6 %s'" "'\n",$0)}' $bindir/cn_ipv6.txt >> /tmp/cn6_$USER.ipset
ipset -! flush cn_ip6 2>/dev/null
ipset -! restore < /tmp/cn6_$USER.ipset
rm -rf cn6_$USER.ipset
Expand Down Expand Up @@ -816,8 +816,8 @@ start_nft(){
ip -6 rule add fwmark 1 table 101 2> /dev/null
ip -6 route add local ::/0 dev lo table 101 2> /dev/null
nft add rule inet shellclash prerouting ip6 daddr {${RESERVED_IP6}} return
[ "$dns_mod" = "redir_host" -a "$cn_ipv6_route" = "已开启" -a -f $bindir/china_ipv6_list.txt ] && {
CN_IP6=$(awk '{printf "%s, ",$1}' $bindir/china_ipv6_list.txt)
[ "$dns_mod" = "redir_host" -a "$cn_ipv6_route" = "已开启" -a -f $bindir/cn_ipv6.txt ] && {
CN_IP6=$(awk '{printf "%s, ",$1}' $bindir/cn_ipv6.txt)
[ -n "$CN_IP6" ] && nft add rule inet shellclash prerouting ip6 daddr {${CN_IP6}} return
}
[ -n "$ipv6_wan" ] && {
Expand Down

0 comments on commit 08cc386

Please sign in to comment.