From db0836e9e0ee8154a15417bad13197bf9bca1ef8 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 19 Jan 2025 17:09:37 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BC=98=E5=8C=96=E4=BA=86nftables=E5=A4=84?= =?UTF-8?q?=E7=90=86=E6=B5=81=E7=A8=8B=20~=E4=BC=98=E5=8C=96=E4=BA=86?= =?UTF-8?q?=E8=87=AA=E5=8A=A8=E4=B8=8B=E8=BD=BD=E6=95=B0=E6=8D=AE=E5=BA=93?= =?UTF-8?q?=E5=8A=9F=E8=83=BD=EF=BC=8C=E7=8E=B0=E5=9C=A8=E4=BC=9A=E8=87=AA?= =?UTF-8?q?=E5=8A=A8=E8=AF=86=E5=88=AB=E9=85=8D=E7=BD=AE=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E4=B8=AD=E6=98=AF=E5=90=A6=E5=AD=98=E5=9C=A8=E7=9B=B8=E5=85=B3?= =?UTF-8?q?=E9=93=BE=E6=8E=A5=EF=BC=8C=E5=A6=82=E6=98=AF=E5=88=99=E4=B8=8D?= =?UTF-8?q?=E8=A7=A6=E5=8F=91=20~=E4=BC=98=E5=8C=96=E6=96=B0=E6=89=8B?= =?UTF-8?q?=E5=BC=95=E5=AF=BC=E9=BB=98=E8=AE=A4=E5=8F=82=E6=95=B0=EF=BC=8C?= =?UTF-8?q?=E7=8E=B0=E5=9C=A8=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8=E7=BB=95?= =?UTF-8?q?=E8=BF=87cnip=E5=8A=9F=E8=83=BD=EF=BC=8C=E9=9D=9Emips=E8=AE=BE?= =?UTF-8?q?=E5=A4=87=E9=BB=98=E8=AE=A4=E5=90=AF=E7=94=A8=E6=B7=B7=E5=90=88?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=20~=E6=96=B0=E6=89=8B=E5=BC=95=E5=AF=BC?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E5=B1=80=E5=9F=9F=E7=BD=91=E8=AE=BE=E5=A4=87?= =?UTF-8?q?=E6=97=B6=EF=BC=8C=E5=A2=9E=E5=8A=A0=E4=BA=86net.bridge.bridge-?= =?UTF-8?q?nf-call-iptables=E7=A6=81=E7=94=A8=EF=BC=8C=E4=BB=A5=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=BE=E5=A4=87=E5=9B=A0docker?= =?UTF-8?q?=E5=86=B2=E7=AA=81=E8=80=8C=E5=AF=BC=E8=87=B4=E4=BB=A3=E7=90=86?= =?UTF-8?q?=E5=BC=82=E5=B8=B8=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 37 ++++++++++++++++--------------------- scripts/webget.sh | 17 +++++++++++++++-- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index d8dd643..a0063ab 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -453,7 +453,7 @@ EOF hosts_ip=$(echo $line | awk '{print $1}') && hosts_domain=$(echo $line | awk '{print $2}') && [ -z "$(cat "$TMPDIR"/hosts.yaml | grep -oE "$hosts_domain")" ] && - echo " '$hosts_domain': $hosts_ip" >>"$TMPDIR"/hosts.yaml + echo " '$hosts_domain': $hosts_ip" >>"$TMPDIR"/hosts.yaml done <$sys_hosts fi #分割配置文件 @@ -533,11 +533,11 @@ EOF #mix模式生成rule-providers [ "$dns_mod" = "mix" ] && ! grep -q 'geosite-cn:' "$TMPDIR"/rule-providers.yaml && ! grep -q 'rule-providers' "$CRASHDIR"/yamls/others.yaml 2>/dev/null && \ cat >>"$TMPDIR"/rule-providers.yaml </dev/null 2>&1; then + redir_mod="Tproxy模式" + else + redir_mod="Redir模式" + fi + setconfig crashcore "clash" + } setconfig redir_mod "$redir_mod" - [ -n "$(echo $cputype | grep -E "linux.*mips.*")" ] && setconfig crashcore "clash" + #默认启用绕过CN-IP + setconfig cn_ip_route 已开启 #自动识别IPV6 [ -n "$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g')" ] && { setconfig ipv6_redir 已开启 setconfig ipv6_support 已开启 setconfig ipv6_dns 已开启 + setconfig cn_ipv6_route 已开启 } #设置开机启动 [ -f /etc/rc.common -a "$(cat /proc/1/comm)" = "procd" ] && /etc/init.d/shellcrash enable @@ -2262,6 +2272,9 @@ userguide(){ sysctl -w net.ipv4.ip_forward=1 } && echo "已成功开启ipv4转发,如未正常开启,请手动重启设备!" || echo "开启失败!请自行谷歌查找当前设备的开启方法!" fi + #禁止docker启用的net.bridge.bridge-nf-call-iptables + sysctl -w net.bridge.bridge-nf-call-iptables=0 + sysctl -w net.bridge.bridge-nf-call-ip6tables=0 elif [ "$num" = 2 ];then setconfig redir_mod "Redir模式" [ -n "$(echo $cputype | grep -E "linux.*mips.*")" ] && setconfig crashcore "clash"