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
- How to Determine an EdgeRouter's MAC Address
- How to Convert a MAC Address to an IPv6 Link-Local Recovery Address
- Related Articles
How to Determine an EdgeRouter's MAC Address
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
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:
- ffee is added in the center of the MAC Address.
- fe80:: is added to the beginning.
- Convert to IPv6 Notation.
- The 7th bit in the original MAC Address is flipped creating a new value.
EdgeRouter eth0 MAC: 04-18-D6-A0-87-C8
Following the steps we mentioned above, the following would happen:
- 04 in HEX is 0000:0100
- 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.
- Final link-local Address: fe80:0:0:0:618:d6ff:fea0:87c8
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: