From d98f6ccef522605daa98e38ebe0bb6c6a688016f Mon Sep 17 00:00:00 2001 From: juewuy Date: Thu, 8 Jan 2026 17:31:17 +0800 Subject: [PATCH] =?UTF-8?q?~Tailscale=E9=80=9A=E5=91=8A=E7=BD=91=E6=AE=B5?= =?UTF-8?q?=E6=94=B9=E4=B8=BA=E4=BD=BF=E7=94=A8=E9=80=8F=E6=98=8E=E8=B7=AF?= =?UTF-8?q?=E7=94=B1ipv4=E7=BD=91=E6=AE=B5=20~bug=20fix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/libs/sb_endpoints.sh | 5 ++++- scripts/menus/dns.sh | 7 ++++++- scripts/start.sh | 6 +++--- scripts/starts/fw_getlanip.sh | 2 +- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/scripts/libs/sb_endpoints.sh b/scripts/libs/sb_endpoints.sh index 55751cfb..820a8500 100644 --- a/scripts/libs/sb_endpoints.sh +++ b/scripts/libs/sb_endpoints.sh @@ -2,7 +2,10 @@ # Copyright (C) Juewuy [ "$ts_service" = ON ] && { - [ "$ts_subnet" = true ] && advertise_routes='"10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16"' + [ "$ts_subnet" = true ] && { + . "$CRASHDIR"/starts/fw_getlanip.sh && getlanip + advertise_routes=$(echo "$host_ipv4"|sed 's/[[:space:]]\+/", "/g; s/^/"/; s/$/"/') + } [ -z "$ts_exit_node" ] && ts_exit_node=false [ -z "$ts_hostname" ] && ts_hostname='ShellCrash' cat >"$TMPDIR"/jsons/tailscale.json <&1 | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Ev 'utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/br.*$//g' | sed 's/metric.*$//g') #ipv4局域网网段 + host_ipv4=$(ip a 2>&1 | grep -w 'inet' | grep 'global' | grep 'brd' | grep -Ev 'utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | grep -E ' 1(92|0|72)\.' | sed 's/.*inet.//g' | sed 's/[[:space:]]br.*$//g' | sed 's/metric.*$//g') #ipv4局域网网段 [ "$ipv6_redir" = "ON" ] && host_ipv6=$(ip a 2>&1 | grep -w 'inet6' | grep -E 'global' | sed 's/.*inet6.//g' | sed 's/scope.*$//g') #ipv6公网地址段 [ -f "$TMPDIR"/ShellCrash.log ] && break [ -n "$host_ipv4" -a "$ipv6_redir" != "ON" ] && break