# Authorization by MAC address

This type of authorization is suitable for those devices whose location changes from time to time between local networks within the organization (for example, employees' work laptops) or network devices that are issued an IP address via DHCP, on which IP+MAC binding is not configured.

<p class="callout warning">In order for a device to be authorized on UTM by MAC address, they must both be in the same broadcast domain, and UTM serves as the gateway for the devices.</p>

<p class="callout info">Users who are behind the router in the local UTM network cannot authorize by MAC address, since the router breaks broadcast domains and does not process L2-level traffic. Such users can authorize only by IP address.</p>

---

#### Configuring MAC Authorization

To authorize a user by MAC address, you need to do the following:

1\. You need to find out the MAC address of the device. To do this, in the Windows command prompt, type the command: `ipconfig /all | findstr Address`  
[![1. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/e6QoVqKdIYUjiDLC-1-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/e6QoVqKdIYUjiDLC-1-authorization-by-mac-address.png)

2\. Make sure that the computer and UTM are in the same broadcast domain.  
To do this, on UTM in Server Management -&gt; Terminal section, enter the command: `ip neigh`

[![2. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/oIGtaChQyAaVNEnH-2-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/oIGtaChQyAaVNEnH-2-authorization-by-mac-address.png)

<p class="callout info">This command outputs the UTM's ARP table, and the presence of an entry with the device MAC address and REACHABLE status indicates L2 availability between UTM and the device.</p>

3\. Create a binding rule **User &lt;--&gt; MAC address** in **Users -&gt; Authorization -&gt; IP and MAC authorization:**

<p class="callout warning">It is not possible to set up permanent authorization for MAC authorization.  
This is technically impossible because an IP address is required to create an authorized session. Therefore, it is recommended to use MAC authorization in combination with a [**DHCP server**](https://docs.safedns.com/books/45-setup-services/page/dhcp-server).</p>

The result can be viewed in **Monitoring -&gt; Authorized users**, where a session with the MAC authorization type will be displayed.  
[![3. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/03xON6PEKqqEWCwW-3-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/03xON6PEKqqEWCwW-3-authorization-by-mac-address.png)

---

#### MAC authorization behavior when moving a device between local networks

In organizations, there is often a situation when it is necessary to move between local networks with a laptop and at the same time always stay online. In such cases, authorization by MAC address works perfectly well.

<p class="callout info">You must have your own DHCP server configured or on SafeUTM. In the distributed credentials, the gateway should be the local SafeUTM interface.</p>

Let's take as an example a situation where a user `Dwight Schrute` needed to move with a laptop between local networks:

- There are local interfaces configured on UTM as follows:  
    [![4. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/Wm7sPFl032kbtAxf-4-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/Wm7sPFl032kbtAxf-4-authorization-by-mac-address.png)
- This user has a MAC address authorization rule configured:  
    [![5. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/2Zt4TdxYs3HeNBs6-5-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/2Zt4TdxYs3HeNBs6-5-authorization-by-mac-address.png)
- He also has one active session in the **Authorized Users** section:  
    [![6. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/f09GVblLOFHrmc1d-6-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/f09GVblLOFHrmc1d-6-authorization-by-mac-address.png)
- Then the user moves from one local network to another. He is given other network credentials from the DHCP server, in which UTM is specified by the gateway, and if any activity on the part of the user is detected, the second session with authorization by MAC address will appear.

<p class="callout info">If the user does not have access and can’t see the second session with authorization by MAC address, then most likely this could have happened due to the fact that the user's network credentials were not updated.  
Reset the old network credentials from the DHCP server and get new ones using the command:  
`ipconfig /release && ipconfig /renew`.</p>

---

#### Configuring MAC Address Authorization for Network Printer and Other Network Devices

<p class="callout info">Network printers and other network devices that need access to the internet must be authorized on UTM. Such devices can be called static and authorization by MAC address is perfect for them.</p>

In order to authorize a network printer, you need to create a user for this printer manually or through [**Netscan**](https://docs.safedns.com/books/42-setup-users/page/netscan).  
[![7. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/Vis8OH4FW5lCuz2W-7-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/Vis8OH4FW5lCuz2W-7-authorization-by-mac-address.png)

For a network printer, in **Users -&gt; Authorization -&gt; IP and MAC authorization you** need to create a rule **User &lt;--&gt; MAC address.  
[![8. Authorization by MAC address.png](https://docs.safedns.com/uploads/images/gallery/2022-08/scaled-1680-/NWDlzJwih6eWEDLS-8-authorization-by-mac-address.png)](https://docs.safedns.com/uploads/images/gallery/2022-08/NWDlzJwih6eWEDLS-8-authorization-by-mac-address.png)**

When detecting activity from a network printer or other device, its user will immediately appear in **Monitoring -&gt; Authorized users.**

<div class="pointer-container" id="bkmrk-%C2%A0"><div class="pointer anim is-page-editable"><svg class="svg-icon" data-icon="link" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg><div class="input-group inline block"> <button class="button outline icon" data-clipboard-target="#pointer-url" title="Copy Link" type="button"><svg class="svg-icon" data-icon="copy" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></button></div><svg class="svg-icon" data-icon="edit" role="presentation" viewbox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"></svg></div></div><p class="callout info">In modern phones, there is an option for **MAC Randomization**. This option will interfere with phone authorization by MAC address. It is recommended to disable this option or use other types of authorization (for example, [**web authorization**](https://docs.safedns.com/books/42-setup-users/page/web-authorization))</p>