Quantcast
Channel: 钻戒 and 仁豆米
Viewing all articles
Browse latest Browse all 290

KVM中网卡地址随机生成方法

$
0
0

用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/.$//'  

Viewing all articles
Browse latest Browse all 290

Trending Articles