EdgeRouter - How to Find Device MAC Address


Overview


This article describes three methods for finding an EdgeRouter's MAC Address, as well as the process followed to manually convert said MAC Address into a IPv6 Link-Local Recovery Address for direct access to the EdgeRouter.


Table of Contents


  1. How to Determine an EdgeRouter's MAC Address
  2. How to Convert a MAC Address to an IPv6 Link-Local Recovery Address
  3. Related Articles

How to Determine an EdgeRouter's MAC Address


Back to Top

Option 1: View the sticker on the product itself. This article can help: Where is my MAC ID and Date Code?

Option 2: SSH Recovery Service (included in firmware 1.10.0+)

If there is access to the EdgeRouter, you can use the command below to stop and restart the SSH Recovery service which displays the MAC address for each interface listening for SSH Recovery.  

sudo ssh-recovery stop
sudo ssh-recovery start

Option 3: Using the Ubiquiti Discovery Tool. See details in this article: How to Access EdgeRouter using Discovery Tool.


How to Convert a MAC Address to an IPv6 Link-Local Recovery Address


Back to Top

The MAC address obtained with the instructions above can be converted to an IPv6 link-local address for direct access to the EdgeRouter. This conversion is done automatically using the Discovery Tool and llssh recovery tool referenced in the Related Articles section. When done manually, the MAC address is converted to a IPv6 link-local address using the MAC address of eth0 on the EdgeRouter. This is done using EUI-64 Conversion and shows in the proper link-local address as the Rescue IP Address. 

There are many calculators online to easily find the IPv6 link-local address without worrying about the steps below. However, here is a brief explanation of how the MAC address to an IPv6 link-local address conversion works:

  1. ffee is added in the center of the MAC Address.
  2. fe80:: is added to the beginning.
  3. Convert to IPv6 Notation.
  4. The 7th bit in the original MAC Address is flipped creating a new value.

Example:

EdgeRouter eth0 MAC: 04-18-D6-A0-87-C8

Following the steps we mentioned above, the following would happen:

  1. 04:18:D6:fffe:A0:87:C8
  2. fe80::04:18:D6:fffe:A0:87:C8
  3. fe80::04:18:D6ff:feA0:87C8
  4. 04 in HEX is 0000:0100
  5. Flipping the 7th bit: 0000:0110 gives us a new value of 6 by adding 4 from the 6th value and 2 from the 7th value which was previously 0.
  6. Final link-local Address: fe80:0:0:0:618:d6ff:fea0:87c8 
NOTE:
When connecting with ssh the local interface must be defined using a % after the link-local address. In this case our PC is connected using interface en4. Therefore to connect to the device using terminal with the rescue IP and “ubnt” as the user, we would use:

ssh ubnt@fe80:0:0:0:618:d6ff:fea0:87c8%en4


Related Articles


Back to Top

EdgeRouter - Last Resort Recovery

EdgeRouter - How to Use SSH Recovery 

EdgeRouter - How to Access EdgeRouter


We're sorry to hear that!