You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
之前使用的是这个命令ip -6 route | awk '{print $1}' | awk '/240:?/' | awk -F::/ '{print $1 ":suffix of other mac"}'
发现当局域网地址第四位是0的情况下会出现获取的ipv6地址第4位无法获取,导致无法正确解析
询问AI后用这个命令就正常了,分享给各位。
ip -6 route | awk -v suf="主机后四位" '/^240/ { split($1, arr, "::/"); prefix=arr[1]; n=split(prefix, tmp, ":"); if(n==3) print prefix":0:"suf; else if(n==4) print prefix":"suf; exit }'
All reactions