New user's registration have been closed due to high spamming and low trafic on this forum. Please contact forum admins directly if you need an account. Thanks !

Changed MAC on Arch B3?

Discuss development on Bubba
Post Reply
stasheck
Posts: 126
Joined: 15 Jan 2014, 13:13

Changed MAC on Arch B3?

Post by stasheck »

I've noticed that my B3 is using "0e:....." MAC address on network cards instead of "00:...", as it used to. In sakaki's wiki, there are some notions that due to how kernel is loaded, special care must be taken when changing network card params.

The question is: how can I revert back to my default MAC, or how to edit MAC properly on Arch? My ISP locks IP address to MAC and it's kind of a hassle to have him change MAC.
Gordon
Posts: 1461
Joined: 10 Aug 2011, 03:18

Re: Changed MAC on Arch B3?

Post by Gordon »

The MAC address that belongs to your B3 is stored in the u-boot environment. You can grab the correct address from there and then use `ifconfig eth0 hw ether <new_mac>` to spoof it. Do note that the interface needs to be down for this to run correctly.

To automate this at boot time, simply add a `pre-up` clause to your interfaces file.
sakaki
Posts: 172
Joined: 15 Aug 2014, 11:20

Re: Changed MAC on Arch B3?

Post by sakaki »

Hi stasheck -

there is a bug in the "/etc/systemd/system/setethermac@.service" file. Please edit it so that the two ExecStart lines read as follows (leave the rest of the file as-is):

Code: Select all

ExecStart=/bin/bash -c "if [[ %i -eq 'eth0' ]]; then ip link set dev eth0 address $(fw_printenv ethaddr|rev|cut -c -17|rev); fi"
ExecStart=/bin/bash -c "if [[ %i -eq 'eth1' ]]; then ip link set dev eth1 address $(fw_printenv eth1addr|rev|cut -c -17|rev); fi"
This should then work whether your version of fw_printenv prefixes the output with the queried variable name, or not.

Once you restart, you should have the correct MAC addresses for your adaptors, and you can check this with "ip link show".

Apologies for the inconvenience, I will re-release the image with this fix applied. Best,

sakaki

Edit: release 1.1.6 of the Arch live-USB is now out, with this fix applied. Thanks again for reporting the issue!
stasheck
Posts: 126
Joined: 15 Jan 2014, 13:13

Re: Changed MAC on Arch B3?

Post by stasheck »

sakaki, thanks a lot for identifying the issue :-) I am still just starting to feel my way around Arch. I like it so far :-)
Post Reply