Use the vSphere Client to enable prefix-based or range-based MAC address allocation and to adjust the allocation parameters.

If you are changing from one type of allocation to another, for example changing from the VMware OUI allocation to a range-based allocation, use the vSphere Client. However, when a schema is prefix-based or range-based and you want to change to a different allocation schema, you must edit the vpxd.cfg file manually and restart vCenter Server.

Change to or Adjust Range- or Prefixed-Based Allocations

By switching from the default VMware OUI to range- or prefixed-based MAC address allocation through the vSphere Client, you can avoid and resolve MAC address duplication conflicts in vSphere deployments.

Change the allocation scheme from the default VMware OUI to range- or to prefixed-based allocation by using the Advanced Settings available for the vCenter Server instance in the vSphere Client.

To switch from range- or prefixed-based allocation back to VMware OUI allocation, or between range- and prefixed-based allocation, edit the vpxd.cfg file manually. See Set or Change Allocation Type.

Procedure

  1. In the vSphere Client, navigate to a vCenter Server instance.
  2. On the Configure tab, expand Settings and select Advanced Settings.
  3. Click Edit Settings.
  4. Add or edit parameters for the target allocation type.
    Use only one allocation type.
    • Change to prefix-based allocation.
      Key Example Value
      config.vpxd.macAllocScheme.prefixScheme.prefix 005026
      config.vpxd.macAllocScheme.prefixScheme.prefixLength 23

      prefix and prefixLength determine the range of MAC address prefixes that newly added vNICs have. prefix is the starting OUI of MAC addresses related to the vCenter Server instance, and prefixLength determines the length of the prefix in bits.

      For example, the settings from the table result in VM NIC MAC addresses starting with 00:50:26 or 00:50:27.

    • Change to range-based allocation.
      Key Example Value
      config.vpxd.macAllocScheme.rangeScheme.range[X].begin 005067000000
      config.vpxd.macAllocScheme.rangeScheme.range[X].end 005067ffffff
      X in range[X] stands for the range sequence number. For example, 0 in range[0] represents the allocation settings of the first range for MAC address allocation.
  5. Click Save.

Set or Change Allocation Type

If you are changing from range- or prefixed-based allocation to the VMware OUI allocation, you must set the allocation type in the vpxd.cfg file and restart the vCenter Server.

Prerequisites

Decide on an allocation type before changing the vpxd.cfg file. For information on allocation types, see MAC Address Assignment from vCenter Server

Procedure

  1. On the host machine of vCenter Server, navigate to the directory /etc/vmware-vpx.
  2. Open the vpxd.cfg file.
  3. Decide on an allocation type to use and enter the corresponding XML code in the file to configure the allocation type.
    The following are examples of XML code to use.
    Note: Use only one allocation type.
    • VMware OUI allocation
      <vpxd>
         <macAllocScheme>
            <VMwareOUI>true</VMwareOUI>
         </macAllocScheme>
      </vpxd>
    • Prefix-based allocation
       <vpxd>
          <macAllocScheme>
            <prefixScheme>
               <prefix>005026</prefix>
               <prefixLength>23</prefixLength>
            </prefixScheme>
         </macAllocScheme>
      </vpxd>
    • Range-based allocation
      <vpxd>
         <macAllocScheme>
             <rangeScheme>
                <range id="0">
                   <begin>005067000001</begin>
                   <end>005067000001</end>
                </range>
             </rangeScheme>
         </macAllocScheme>
      </vpxd>
  4. Save the vpxd.cfg.
  5. Restart the vCenter Server host.