Skip to content
View in the app

A better way to browse. Learn more.

Armbian Community Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

armbian-install: can we set a custom or random macaddress ?

Featured Replies

 

I had a need to change the macaddress of this device, after looking through the bootloader I spotted 2 offsets:

  • 0x380400 macaddress NIC1
  • 0x380406 macaddress NIC2

 

I would love an option in the installer, but I did it manually now:

 

# dd if=/dev/mmcblk2 bs=16M count=1 of=bootloader
1+0 records in
1+0 records out
16777216 bytes (17 MB, 16 MiB) copied, 0,0736928 s, 228 MB/s

# read_mac bootloader 0x380400
9c:d5:dc:b2:ce:1c

# write_mac bootloader 0x380400 $(random_mac)
write_mac bootloader 0x380400 $(random_mac)

# read_mac bootloader 0x380400
b0:3f:1a:83:9a:da

 

After scripting a couple of functions of course: ;)

 

### Functions read_mac , write_mac and random_mac are hereby licensed under GPLv3

# read_mac file offset
# read_mac bootloader 0x380400
# read_mac /dev/mmcblk2 0x380400
read_mac(){ 
  dd if=$1 bs=1 count=6 skip=$(($2)) 2>/dev/null |\
    xxd -l 16 -p | sed 's/../:&/g;s/^://'
}

# write_mac file offset macaddress
# write_mac bootloader 0x380400 aa:bb:cc:dd:ee:ff
# write_mac /dev/mmcblk2 0x380400 aa:bb:cc:dd:ee:ff
write_mac(){
  for hex in $(echo $3|tr ':' ' ');do printf "\x$hex";done |\
    dd of=$file bs=1 count=6 seek=$(($offset)) conv=notrunc 2>/dev/null
}

# print a random macaddress
random_mac(){
  printf "%012x" \
    $(( 0x$(hexdump -n6 -ve '/1 "%02X"' /dev/urandom) & 0xFCFFFFFFFFFF )) |\
      sed 's/../:&/g;s/^://'
}

 

Edited by Dantes

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.