用bash的随机生成网卡地址:

echo 52:54:$(dd if=/dev/urandom count=1 2>/dev/null | md5sum | sed 's/^\(..\)\(..\)\(..\)\(..\).*$/\1:\2:\3:\4/')  
52:54:f6:65:52:39  

另一种做法:

openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//'  
comments powered by Disqus