From 6976219544b78fedb4ba8766a5d68684d4df5ae2 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Tue, 24 Oct 2023 17:11:17 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E6=94=AF=E6=8C=81=20onlink=20=E8=B7=AF?= =?UTF-8?q?=E7=94=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alpine-network.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/alpine-network.sh b/alpine-network.sh index f37cc9f..4ec4a37 100644 --- a/alpine-network.sh +++ b/alpine-network.sh @@ -48,11 +48,11 @@ is_have_ipv6 && dhcpv6_or_slaac=true || dhcpv6_or_slaac=false # 设置静态地址 if ! is_have_ipv4 && [ -n "$ipv4_addr" ] && [ -n "$ipv4_gateway" ]; then ip -4 addr add "$ipv4_addr" dev eth0 - ip -4 route add default via "$ipv4_gateway" + ip -4 route add default dev eth0 via "$ipv4_gateway" onlink fi if ! is_have_ipv6 && [ -n "$ipv6_addr" ] && [ -n "$ipv6_gateway" ]; then ip -6 addr add "$ipv6_addr" dev eth0 - ip -6 route add default via "$ipv6_gateway" + ip -6 route add default dev eth0 via "$ipv6_gateway" onlink fi # 检查 ipv4/ipv6 是否连接联网