From d2d6049bbdcce230c4f5c9063fc98274f9c65c34 Mon Sep 17 00:00:00 2001 From: bin456789 Date: Sun, 11 Aug 2024 22:49:59 +0800 Subject: [PATCH] =?UTF-8?q?core:=20=E8=AE=BE=E7=BD=AE=E7=BD=91=E7=BB=9C?= =?UTF-8?q?=E6=97=B6=E8=BF=87=E6=BB=A4=20azure=20vf?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- alpine-network.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/alpine-network.sh b/alpine-network.sh index 4535e87..a346d45 100644 --- a/alpine-network.sh +++ b/alpine-network.sh @@ -25,10 +25,13 @@ fi # debian 11 initrd 没有 xargs awk # debian 12 initrd 没有 xargs get_ethx() { + # 过滤 azure vf (带 master ethx) + # 2: eth0: mtu 1500 qdisc mq state UP qlen 1000\ link/ether 60:45:bd:21:8a:51 brd ff:ff:ff:ff:ff:ff + # 3: eth1: mtu 1500 qdisc mq master eth0 state UP qlen 1000\ link/ether 60:45:bd:21:8a:51 brd ff:ff:ff if false; then - ip -o link | grep -i "$mac_addr" | awk '{print $2}' | cut -d: -f1 + ip -o link | grep -i "$mac_addr" | grep -v master | awk '{print $2}' | cut -d: -f1 else - ip -o link | grep -i "$mac_addr" | cut -d' ' -f2 | cut -d: -f1 + ip -o link | grep -i "$mac_addr" | grep -v master | cut -d' ' -f2 | cut -d: -f1 fi }