From 792edb67a46c59a43dd8a73603a6520c37e39e60 Mon Sep 17 00:00:00 2001 From: juewuy Date: Sun, 30 Jun 2024 15:49:10 +0800 Subject: [PATCH] =?UTF-8?q?~=E4=BC=98=E5=8C=96=E6=9C=AC=E6=9C=BA=E5=87=BA?= =?UTF-8?q?=E5=8F=A3IP=E8=8E=B7=E5=8F=96=E6=9C=BA=E5=88=B6=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E9=83=A8=E5=88=86=E8=AE=BE=E5=A4=87=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E6=AD=A3=E5=B8=B8=E4=BB=A3=E7=90=86=E6=9C=AC=E6=9C=BA?= =?UTF-8?q?=E6=B5=81=E9=87=8F=E7=9A=84=E9=97=AE=E9=A2=98=20~meta=E7=9A=84t?= =?UTF-8?q?un=E5=8F=82=E6=95=B0=E6=94=B9=E4=B8=BAauto-detect-interface:=20?= =?UTF-8?q?false,=E7=94=A8=E4=BA=8E=E8=A7=A3=E5=86=B3=E9=83=A8=E5=88=86?= =?UTF-8?q?=E7=94=A8=E6=88=B7=E6=97=A0=E6=B3=95=E8=AE=BF=E9=97=AE=E5=86=85?= =?UTF-8?q?=E7=BD=91=E8=AE=BE=E5=A4=87=E7=9A=84=E9=97=AE=E9=A2=98(?= =?UTF-8?q?=E5=AE=9E=E9=AA=8C=E6=80=A7)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/start.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/start.sh b/scripts/start.sh index 646e079..5669843 100644 --- a/scripts/start.sh +++ b/scripts/start.sh @@ -199,7 +199,7 @@ getlanip() { #获取局域网host地址 [ -z "$host_ipv4" ] && host_ipv4='192.168.0.0/16 10.0.0.0/12 172.16.0.0/12' host_ipv6="fe80::/10 fd00::/8 $host_ipv6" #获取本机出口IP地址 - local_ipv4=$(ip route 2>&1 | grep 'src' | grep -Ev 'utun|iot|docker' | grep -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3} $' | sed 's/.*src //g') + local_ipv4=$(ip route 2>&1 | grep -Ev 'utun|iot|docker|linkdown' | grep -Eo 'src.*' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u) [ -z "$local_ipv4" ] && local_ipv4=$(ip route 2>&1 | grep -Eo 'src.*' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | sort -u) #保留地址 reserve_ipv4="0.0.0.0/8 10.0.0.0/8 127.0.0.0/8 100.64.0.0/10 169.254.0.0/16 172.16.0.0/12 192.168.0.0/16 224.0.0.0/4 240.0.0.0/4" @@ -347,7 +347,7 @@ modify_yaml() { #修饰clash配置文件 [ "$ipv6_dns" = "已开启" ] && dns_v6='true' || dns_v6='false' external="external-controller: 0.0.0.0:$db_port" if [ "$redir_mod" = "混合模式" -o "$redir_mod" = "Tun模式" ]; then - [ "$crashcore" = 'meta' ] && tun_meta=', device: utun, auto-route: false' + [ "$crashcore" = 'meta' ] && tun_meta=', device: utun, auto-route: false, auto-detect-interface: false' tun="tun: {enable: true, stack: system$tun_meta}" else tun='tun: {enable: false}'