Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GenerateMAC ¶
func GenerateMAC() net.HardwareAddr
GenerateMAC will generate MAC addresses with fixed first 24 bits (CNI OUI), and the last 24 bits will be random, so there are at most 16777216(2^24) different addresses. To avoid MAC address collision as much as possible, this function is suggested to be used within the limitation that each subnet should contain no more 1024(2^10) using IP addresses. For example, a subnet whose prefix is greater or equal than 22 is safe to use this function as MAC address generator.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.