OpenSSL generates a random MAC address method

  
                  

In Xen's DomU configuration file, we want to specify the MAC address, using a panel similar to SolusVM, this step is omitted. But if you abandon the panel, deploy Xen yourself and create DomU, when we need to write the MAC address in the configuration file, we need to use the method of this article to generate. Although we can generate MAC addresses through some online tools, such as Mac Address Generator, it is obviously more convenient if we can generate them on the command line.

This article describes how to generate a random MAC address with the openssl command. The command is very simple, and it is not always used. It is only a record here, eliminating the need to search the Internet when it is needed.

Installing openssl

yum -y install openssl openssl-devel

or

apt-get -y install openssl openssl-dev

Generate MAC Address

openssl rand -hex 6

Copyright © Windows knowledge All Rights Reserved