Skip to content

Instantly share code, notes, and snippets.

@tosin2013
Last active May 24, 2022 15:54
Show Gist options
  • Save tosin2013/eb9e67ab88da09b9597f1b7760f199c9 to your computer and use it in GitHub Desktop.
Save tosin2013/eb9e67ab88da09b9597f1b7760f199c9 to your computer and use it in GitHub Desktop.
mac Generator for openshift deployments on vmware

ETHERNET ADAPTOR HARDWARE ADDRESS REQUIREMENTS
When provisioning VMs for the cluster, the ethernet interfaces configured for each VM must use a MAC address from the VMware Organizationally Unique Identifier (OUI) allocation ranges:

00:05:69:00:00:00 to 00:05:69:FF:FF:FF

00:0c:29:00:00:00 to 00:0c:29:FF:FF:FF

00:1c:14:00:00:00 to 00:1c:14:FF:FF:FF

00:50:56:00:00:00 to 00:50:56:FF:FF:FF

If a MAC address outside the VMware OUI is used, the cluster installation will not succeed.

#!/bin/bash

arr[0]="00:05:69:"
arr[1]="00:0c:29:"
arr[2]="00:1c:14:"
arr[3]="00:50:56:"

rand=$[$RANDOM % ${#arr[@]}]
end="$( echo $[RANDOM%10]$[RANDOM%10]:$[RANDOM%10]$[RANDOM%10]:$[RANDOM%10]$[RANDOM%10])"
echo "${arr[$rand]}$end"

https://docs.openshift.com/container-platform/4.3/installing/installing_vsphere/installing-vsphere.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment