Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save dev-made/757a1ca047be1f29f844b9388d9af7a8 to your computer and use it in GitHub Desktop.
Save dev-made/757a1ca047be1f29f844b9388d9af7a8 to your computer and use it in GitHub Desktop.

Revisions

  1. @SystemJargon SystemJargon revised this gist Jun 29, 2022. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions randomized-mac-addresses-options.md
    Original file line number Diff line number Diff line change
    @@ -6,6 +6,8 @@ From an I.T op perspective, this may cause DHCP pool exhaustion issues.

    From a user perspective, they may not know what issues this may cause, besides a "I can't connect to the network anymore" issue.

    This maybe of interest too, https://github.com/SystemJargon/mac-changer

    ----

    ## Mitigation:
  2. @SystemJargon SystemJargon revised this gist May 30, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion randomized-mac-addresses-options.md
    Original file line number Diff line number Diff line change
    @@ -38,7 +38,7 @@ New-ItemProperty -Path "$RegPath\$($Key.PSChildName)" -Name "NetworkAddress" -Va

    ----

    Windows Registry Edit
    Windows Registry Edit to disable randomize mac address feature

    ```
  3. @SystemJargon SystemJargon created this gist May 30, 2022.
    65 changes: 65 additions & 0 deletions randomized-mac-addresses-options.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,65 @@
    ## Randomized MAC addresses

    Most modern client devices may now support, random hardware address aka randomized mac addresses.

    From an I.T op perspective, this may cause DHCP pool exhaustion issues.

    From a user perspective, they may not know what issues this may cause, besides a "I can't connect to the network anymore" issue.

    ----

    ## Mitigation:

    Lowering the DCHP lease time might mitigate this issue to some degree.

    Adopt FastRoaming or even OpenRoaming (the latter being part of Cisco DNA Spaces, now adopted as an industry standard for seamless Wi-Fi onboarding)

    Implement policies on company or owned devices, i.e. to turn off MAC randomization for the company-owned devices or BYOD devices if the company policy allows it.

    Ask users to turn off MAC randomization on their devices where and if possible.

    ----

    Powershell Script to disable randomize mac address feature

    ```
    $WiFi = Get-NetAdapter -Name "Wi-Fi"
    $RegPath = "HKLM:\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}"
    ($Key = Get-ItemProperty -Path "$RegPath\*" -Name "AdapterModel") 2> $Null
    If ($Key.AdapterModel -eq $WiFi.InterfaceDescription){
    New-ItemProperty -Path "$RegPath\$($Key.PSChildName)" -Name "NetworkAddress" -Value $($WiFi.MacAddress) -PropertyType String -Force}
    ```

    ----

    Windows Registry Edit

    ```
    1. Win+R, run regedit.exe
    2. Locate the network adapter configuration that was configured with the random mac address feature in
    HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}
    The network adapter maker's name can suggest the proper subfolder of {4D36E972-E325-11CE-BFC1-08002BE10318}.
    3. Right-click on the folder that matches your device. For example, if the "0001" folder matches your device, right-click on the folder. Select New → String Value. Name the new value "NetworkAddress".
    4. Double-click the new Network Address entry. In the "Value data" field, enter your new MAC address. MAC addresses are 12-digit values, and should be entered without any dashes or colons. For example, if you want to make the MAC address "2A:1B:4C:3D:6E:5F", you would enter "2A1B4C3D6E5F"
    5. Restart the computer. You will notice in the wifi adapter advanced configuration settings that the random mac address option is greyed out.
    ```

    ----

    References

    https://support.microsoft.com/en-us/windows/how-to-use-random-hardware-addresses-in-windows-ac58de34-35fc-31ff-c650-823fc48eb1bc

    https://documentation.meraki.com/General_Administration/Cross-Platform_Content/Meraki_and_iOS_14_MAC_Address_Randomization