发布网友 发布时间:2022-04-19 14:30
共1个回答
热心网友 时间:2023-09-23 20:27
echo "00:00:27:1d:01:ff"|awk -F":" 'BEGIN{hex=256}function dtoh(i){return strtonum("0x"i)}{mac=dtoh($1)*hex^5+dtoh($2)*hex^4+dtoh($3)*hex^3+dtoh($4)*hex^2+dtoh($5)*hex+dtoh($6);mac++;printf("%02x:%02x:%02x:%02x:%02x:%02x\n",int(mac/hex^5),int(mac%hex^5/hex^4),int(mac%hex^5%hex^4/hex^3),int(mac%hex^5%hex^4%hex^3/hex^2),int(mac%hex^5%hex^4%hex^3%hex^2/hex),mac%hex^5%hex^4%hex^3%hex^2%hex)}'