Fixed mac address on the BeagleBoard-xm

This forum is for supported devices using an ARMv7 Texas Instruments (TI) SoC.

Fixed mac address on the BeagleBoard-xm

Postby gdamjan » Sun Jun 24, 2012 8:01 pm

The BeagleBoard-xm doesn't have a hardware mac address, so it generates one on each reboot.
I'd like to fix it, so that I can assign some parameters to it from my dhcp server.

What would be the best way to do it in ArchLinux, considering I'm running a systemd native Arch, and wicd for automatic handling of network interfaces?
gdamjan
 
Posts: 10
Joined: Mon Jan 16, 2012 7:06 pm

Re: Fixed mac address on the BeagleBoard-xm

Postby pepedog » Sun Jun 24, 2012 8:26 pm

I think it's a smsc95xx, same as rasberrypi pi.
There is a kernel patch (search google for smsc95xx mac address), or maybe you can assign another way before network starts
pepedog
Developer
 
Posts: 2431
Joined: Mon Jun 07, 2010 3:30 pm
Location: London UK

Re: Fixed mac address on the BeagleBoard-xm

Postby gdamjan » Sun Jun 24, 2012 9:25 pm

I tried adding "ethaddr=8e:37:6f:cb:4d:81" to uEnv.txt but that didn't work (that's maybe dependent on that kernel patch).

In the end, I just made a udev rule. Seems to work ok.
/etc/udev/rules.d/99-mac-address.rules
Code: Select all
SUBSYSTEM=="net", KERNEL=="eth0", RUN+="/usr/sbin/ip link set dev %k address 8e:37:6f:cb:4d:81"

I should maybe match more attributes just in case, but it's ok for now.

ps.
to find udev attributes of a net device use this command:
Code: Select all
udevadm info -a -p /sys/class/net/eth0
gdamjan
 
Posts: 10
Joined: Mon Jan 16, 2012 7:06 pm

Re: Fixed mac address on the BeagleBoard-xm

Postby android » Sun Jul 15, 2012 4:50 pm

I fix this issue by creating a file: /etc/rc.d/functions.d/macspoof

The contents of this file are:
Code: Select all
spoof_mac() {
        ip link set dev eth0 address 01:02:03:04:05:06
}

add_hook sysinit_end spoof_mac


Make the address whatever you like.

P.S. I also create a file: /etc/rc.d/functions.d/sshd-close-sessions

Which contains:
Code: Select all
# Close sshd sessions before shutting down the network; see FS#17389.

sshd_close_sessions () {
        if ck_daemon sshd; then
                return
        fi
        /etc/rc.d/sshd stop
        stat_busy "Stopping Secure Shell Sessions"
        for i in $(pgrep sshd); do
                if readlink -q /proc/$i/exe | grep -q '^/usr/sbin/sshd'; then
                        kill $i
                fi
        done &>/dev/null
        stat_done
}

add_hook shutdown_start sshd_close_sessions


This will close all ssh login sessions on system reboot.

HTH...

android
android
 
Posts: 17
Joined: Sat Apr 16, 2011 7:47 pm


Return to Texas Instruments (TI)

Who is online

Users browsing this forum: No registered users and 0 guests