From 39084ffd1e8459d0a0ef0795b2c92b4f98f4e673 Mon Sep 17 00:00:00 2001 From: Feng Yu Date: Sat, 28 Mar 2026 12:03:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=20ipv6=20DNS=20=E6=8B=A6?= =?UTF-8?q?=E6=88=AA=E9=94=99=E8=AF=AF=E7=9A=84=E7=BD=91=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- scripts/starts/fw_getlanip.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/scripts/starts/fw_getlanip.sh b/scripts/starts/fw_getlanip.sh index bc9d0028..1b784e99 100644 --- a/scripts/starts/fw_getlanip.sh +++ b/scripts/starts/fw_getlanip.sh @@ -1,9 +1,10 @@ - getlanip() { #获取局域网host地址 i=1 while [ "$i" -le "20" ]; do - host_ipv4=$(ip route show scope link | grep -Ev 'wan|utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | awk '{print $1}') #ipv4局域网网段 - [ "$ipv6_redir" = "ON" ] && host_ipv6=$(ip -6 route show default | awk '{print $3}' | tr '\n' ' ' | sed 's/ $//') #ipv6公网地址段 + #ipv4局域网网段 + host_ipv4=$(ip route show scope link | grep -Ev 'wan|utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | awk '{print $1}') + #ipv6局域网网段 + [ "$ipv6_redir" = "ON" ] && host_ipv6=$(ip -6 route show | grep -Ev 'default|unreachable|fe80::/|wan|ppp|utun|iot|peer|docker|podman|virbr|vnet|ovs|vmbr|veth|vmnic|vboxnet|lxcbr|xenbr|vEthernet' | awk '{print $1}' | tr '\n' ' ' | sed 's/ $//') [ -f "$TMPDIR"/ShellCrash.log ] && break [ -n "$host_ipv4" -a "$ipv6_redir" != "ON" ] && break [ -n "$host_ipv4" -a -n "$host_ipv6" ] && break @@ -24,7 +25,7 @@ getlanip() { #获取局域网host地址 if [ "$replace_default_host_ipv4" == "ON" ]; then host_ipv4="$cust_host_ipv4" else - host_ipv4=$(echo "$host_ipv4 $cust_host_ipv4$ts_host_ipv4$wg_host_ipv4"| tr '\n' ' ' | sed 's/ $//') + host_ipv4=$(echo "$host_ipv4 $cust_host_ipv4$ts_host_ipv4$wg_host_ipv4" | tr '\n' ' ' | sed 's/ $//') fi #缺省配置 [ -z "$host_ipv4" ] && { @@ -38,4 +39,4 @@ getlanip() { #获取局域网host地址 #保留地址 [ -z "$reserve_ipv4" ] && 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" [ -z "$reserve_ipv6" ] && reserve_ipv6="::/128 ::1/128 ::ffff:0:0/96 64:ff9b::/96 100::/64 2001::/32 2001:20::/28 2001:db8::/32 2002::/16 fe80::/10 ff00::/8" -} \ No newline at end of file +}