MAC ランダム化機能を使用すると、デバイスは Wi-Fi ネットワークへの接続時に、ランダム化された MAC アドレスを使用できます。実装手順については、MAC ランダム化の実装をご覧ください。このページでは、Android における MAC ランダム化の動作について説明します。
デバイスは、Wi-Fi ネットワークまたはアクセス ポイントへの接続時に、MAC アドレスを使用します。これらの MAC アドレスは暗号化されずに送信されるため、キャプチャされてユーザーの位置情報のトラッキングに使用される可能性があります。従来、デバイスは Wi-Fi ネットワークへの関連付けを行う際に、出荷時 MAC アドレスを使用していました。出荷時 MAC アドレスはグローバルに一意であり、かつ静的であるため、デバイスをトラッキングして個別に識別することが可能です。
MAC ランダム化機能を使用すると、Wi-Fi ネットワークへの接続時にランダム化された MAC アドレスが使用されるため、ユーザーのプライバシーが強化されます。
Android 10 以降を搭載したデバイスの場合、デフォルトではフレームワークはランダム化された MAC アドレスを使用します。図 1 に示すように、ユーザーは [設定] の [ネットワークの詳細] 画面のオプションを使用して、個々のネットワークに対して MAC ランダム化を有効または無効にできます。ユーザーがネットワークに対して MAC ランダム化を無効にすると、フレームワークは出荷時 MAC アドレス(グローバルに一意のアドレス)を使用します。
図 1. MAC ランダム化のオプション
MAC ランダム化の種類
Android フレームワークは、2 種類の MAC ランダム化(永続的ランダム化と非永続的ランダム化)を使用します。ユーザーが MAC ランダム化を無効にすると、出荷時 MAC アドレスが使用されます。
Android は、デバイスが Wi-Fi ネットワークへの関連付けを行う際に、どちらの種類の MAC ランダム化を使用するかを決定します。デフォルトでは、Android は永続的ランダム化を使用します。Android 12 以降、Android は次の場合に非永続的ランダム化を使用します。
MAC ランダム化機能が有効になっている場合、Android はデフォルトで永続的ランダム化を使用します。Android は、SSID、セキュリティ タイプ、FQDN(Passpoint ネットワークの場合)などのネットワーク プロファイルのパラメータに基づいて、永続的にランダム化された MAC アドレスを生成します。この MAC アドレスは、出荷時の設定にリセットするまで変更されません。ユーザーが Wi-Fi ネットワークを削除して再度追加しても、MAC アドレスはネットワーク プロファイルのパラメータに依存するため、再ランダム化されません。
永続的な MAC アドレスは、ネットワークがユーザーに有用な機能を提供するために MAC アドレスの永続性に依存する場合に必要です。たとえば、デバイスを記憶して、想定されるログイン画面の迂回をユーザーに許可する場合や、保護者による使用制限を有効にする場合があります。
Android 12 以降で一部のネットワークに対して使用される非永続的ランダム化では、接続を開始するたびに Wi-Fi モジュールが MAC アドレスを再ランダム化するか、フレームワークが既存のランダム化された MAC アドレスを使用してネットワークに接続します。Wi-Fi モジュールは、次の場合に MAC アドレスを再ランダム化します。
[[["わかりやすい","easyToUnderstand","thumb-up"],["問題の解決に役立った","solvedMyProblem","thumb-up"],["その他","otherUp","thumb-up"]],[["必要な情報がない","missingTheInformationINeed","thumb-down"],["複雑すぎる / 手順が多すぎる","tooComplicatedTooManySteps","thumb-down"],["最新ではない","outOfDate","thumb-down"],["翻訳に関する問題","translationIssue","thumb-down"],["サンプル / コードに問題がある","samplesCodeIssue","thumb-down"],["その他","otherDown","thumb-down"]],["最終更新日 2025-03-25 UTC。"],[],[],null,["The MAC randomization feature lets devices use a randomized MAC address\nwhen connecting to a Wi-Fi network. For implementation instructions, see\n[Implement MAC randomization](/docs/core/connect/wifi-mac-randomization).\nThis page describes the behavior of MAC randomization in Android.\n\nMAC addresses are used by devices when connecting to a Wi-Fi network\nor an access point. Because these MAC addresses are transmitted without\nencryption, they can be captured and used to potentially track a user's\nlocation. Historically, devices use the *factory MAC address* to associate to\na Wi-Fi network. The factory MAC address is globally unique and static, letting\nthe device be tracked and individually identified.\n\nThe MAC randomization feature increases user privacy by using a randomized MAC\naddress when connecting to a Wi-Fi network.\n\nMAC addresses are 48 bits long and usually represented by 12 hex digits\n(6 octets as each octet is 8 bits) such as `00:11:22:AA:BB:CC`. The MAC\nrandomization feature randomizes the address by setting the *locally\nadministered* bit to 1, and the *unicast* bit to 0. The other 46 bits are\nrandomized.\n\nFor devices running Android 10 or higher, the framework uses randomized MAC\naddress by default. Users can enable or disable MAC randomization for individual\nnetworks through an option in the **Network details** screen in **Settings**,\nas shown in Figure 1. If a user disables MAC randomization for a network, the\nframework uses the factory MAC address (globally unique address).\n\n**Figure 1.** MAC randomization option.\n\nMAC randomization types\n\nThe Android framework uses two types of MAC randomization:\n[*persistent randomization*](#persistent) and\n[*non-persistent randomization*](#non-persistent). If the user\ndisables MAC randomization, the factory MAC address is used.\n\nAndroid determines which MAC randomization type to use when the device\nassociates to a Wi-Fi network. By default, Android uses persistent\nrandomization. Starting in Android 12, Android\nuses non-persistent randomization in the following situations:\n\n- A network suggestion app specifies that non-persistent randomization be used for the network through the [`WifiNetworkSuggestion.Builder#setMacRandomizationSetting`](https://developer.android.com/reference/android/net/wifi/WifiNetworkSuggestion.Builder#setMacRandomizationSetting(int)) API.\n- The network is an open network that hasn't encountered a captive portal and the `config_wifiAllowEnhancedMacRandomizationOnOpenSsids` overlay is set to `true`. This overlay is disabled (set to `false`) by default.\n\n| **Note:** The Network Details settings screen does not let users control what MAC randomization type is used. Users are only able to enable and disable the MAC randomization feature as a whole for a given network.\n\nPersistent randomization\n\nAndroid uses the persistent randomization type by default when the MAC\nrandomization feature is enabled. Android generates a persistent randomized MAC\naddress based on the parameters of the network profile including SSID, security\ntype, or FQDN (for Passpoint networks). This MAC address remains the same until\nfactory reset. The MAC address does **not** get re-randomized if the user\nforgets and re-adds the Wi-Fi network since the MAC addressed depends on the\nparameters of the network profile.\n\nPersistent MAC addresses are necessary in cases where networks rely on the\npersistence of the MAC address to provide useful functionality to the user, for\nexample, to remember a device and let users bypass the login screen as\nexpected, or to enable parental controls.\n\nFor Android 10 and 11, the framework uses persistent randomization for all\nnetworks when MAC randomization is enabled.\n\nNon-persistent randomization\n\nUnder the non-persistent randomization type, which is used for some networks in\nAndroid 12 or higher, the Wi-Fi module re-randomizes\nthe MAC address at the start of every connection or the framework uses the\nexisting randomized MAC address to connect to the network. The Wi-Fi module\nre-randomizes the MAC address in the following situations:\n\n- The DHCP lease duration has expired and more than 4 hours have elapsed since the device last disconnected from this network.\n- The current randomized MAC for the network profile was generated more than 24 hours ago. MAC address re-randomization only happens at the start of a new connection. Wi-Fi won't actively disconnect for the purpose of re-randomizing a MAC address.\n\nIf none of these situations apply, the framework uses the previously randomized\nMAC address to connect to the network.\n\nDeveloper option for non-persistent randomization\n\nFor devices running Android 11 or higher, users can enable\nnon-persistent MAC randomization globally for all Wi-Fi networks (that have MAC\nrandomization enabled) through the\n[developer options](https://developer.android.com/studio/debug/dev-options)\nscreen. The option to enable non-persistent MAC randomization for all profiles\nis found at **Settings \\\u003e Developer Options \\\u003e Wi-Fi non-persistent MAC\nrandomization**.\n\n**Figure 2.** Wi-Fi non-persistent MAC randomization option."]]