Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Tool to read the real MAC address of a Jetson Nano
# This script reads the correct MAC address of a Jetson Nano from the onboard EEPROM over i2c.
# First install i2c-tools package. Then make this script executable, and run it with sudo:
# $ sudo apt-get install i2c-tools
# $ chmod +x
# $ sudo ./
# MAC address is xx:xx:xx:xx:xx:xx
# The ‘ip’ command can then change the MAC to above, but it does not persist after rebooting.
# $ ip link set dev eth0 address xx:xx:xx:xx:xx:xx
# There’s also a “macchanger” package that can be installed, has a text UI, and enables a service to
# change the MAC persistently (but not permanently). A patch is being developed for the permanent fix.
# For more info, see this forum thread:
if [ `whoami` != root ]; then
echo "Error -- run this script with sudo:"
echo " \"sudo $0\""
exit 1
mapfile -t mac_lines < <( i2cdump -y -r 172-177 2 0x50 b )
if [ "$len" -ne "3" ]; then
echo "FAILED to read MAC address from i2c..."
echo "EEPROM content:"
i2cdump -y 2 0x50 b
echo "MAC address is ${mac_strB[2]}:${mac_strB[1]}:${mac_strA[4]}:${mac_strA[3]}:${mac_strA[2]}:${mac_strA[1]}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment