版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shida_csdn/article/details/83413458
一、设置步骤
注意替换 以下命令中的 ens160 为你的实际网卡名称
# ifconfig ens160 down # 首先停止相应网卡
# ifconfig ens160 hw ether 02:42:80:63:2e:54 # 设置 mac 地址
# ifconfig ens160 up # 启动网卡设备
二、生成随机的 MAC 地址
# echo "00$(dd bs=1 count=5 if=/dev/random 2>/dev/null |hexdump -v -e '/1 ":%02X"')"