mac

package
v0.2.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 14, 2021 License: Apache-2.0 Imports: 3 Imported by: 0

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL