MAC change after rescue procedure.
Forum » Forum / Backup & Recovery » MAC change after rescue procedure.
Started by: judassjudass
On: 1201202300|%e %b %Y, %H:%M %Z|agohover
Number of posts: 18
rss icon RSS: New posts
Summary:
Or is it just me?
MAC change after rescue procedure.
judassjudass 1201202300|%e %b %Y, %H:%M %Z|agohover

I got a MyBook WE 1 a week ago and managed to brick it after just 15 minutes of work. Before that I have set up my network card for testing purposes — nothing fancy, masquerade for internet access tru wifi with ipmasq and dnsmasq with DHCP (single, private IP to my MyBook, based upon MAC address).

After the crash I revived my drive with usb2sata cable and images posted on this friendly wiki. Next I've connected the drive to my notebook, started all needed scripts and… IP address not present. After few minutes it came down to a last-chance-of-resort: arp check. It boils down to this: MyBook physical address is different this time around, so it doesn't get right IP from DHCP service (luckily I've set up different IP as a default, so disk still gets that other one). My question: is this right, or am I paranoid? Shouldn't physical address be… dunno, physical? Is rescue procedure to blame? ;-) Or is it me? ;-) Can I get my old MAC back, thankyous? ;)

Cheers.

unfold MAC change after rescue procedure. by judassjudass, 1201202300|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure. RESOLVED!!!!!
ETMegabyteETMegabyte 1246307609|%e %b %Y, %H:%M %Z|agohover

A solution to this problem has been found!!!!!!

Check here for the solution!

http://mybookworld.wikidot.com/how-to-change-your-mbwe-bluering-mac-address

I've tested it using my own linux installation, and it works. It will take a little bit of linux knowledge. If you can't figure it out on your own, PM me with your mac address and I can give you the proper checksum bytes… Or post them here, and I'll reply with them if you don't mind your MAC address being public…

Public posting of them will be even better, since it'll give others who don't really care about having THEIR mac address back, but just want a different mac address than what's in the rescue procedure, the ability to have a list of MACs to choose from…

-ET

last edited on 1246307761|%e %b %Y, %H:%M %Z|agohover by ETMegabyte + show more
unfold Re: MAC change after rescue procedure. RESOLVED!!!!! by ETMegabyteETMegabyte, 1246307609|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
sforgetsforget 1201204289|%e %b %Y, %H:%M %Z|agohover

Most modern network cards have the ability to change their mac address. It is quite possible that your mybook is now using the Mac address used by the book the rescue images came from.

I do not know how myself, but it is possible to change the mac address back to the original (not sure if you need to know the original still or not).

unfold Re: MAC change after rescue procedure. by sforgetsforget, 1201204289|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
judassjudass 1201207941|%e %b %Y, %H:%M %Z|agohover

Yes, I am aware of this. I even tried grepping trough system files to locate the script that might change this detail, but no success here. I know my previous mac, so it should not be difficult to change hw ether. But I wonder: how is this happening, is it some binary detail or a script (that I was not able to locate) doing? I was just curious if anybody else spotted anything like it. Y'know, fine detail and all. ;)

unfold Re: MAC change after rescue procedure. by judassjudass, 1201207941|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
alephsmithalephsmith 1201242303|%e %b %Y, %H:%M %Z|agohover

I don't know if you are asking- but you should be able to change your MAC with ifconfig.

unfold Re: MAC change after rescue procedure. by alephsmithalephsmith, 1201242303|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
judassjudass 1201286739|%e %b %Y, %H:%M %Z|agohover

Aye, issuing „ifconfig INTERFACE hw ether MAC” should do the trick, but. I would like to know where did the change come from in the first place. Haven't found anything in config files.

Changing it back is patching, a rather imperfect solution, since I don't know the origin of first change. Anyway thanks for your responses. I will repost if I get anything.

Cheers.

unfold Re: MAC change after rescue procedure. by judassjudass, 1201286739|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
shemersshemers 1211900529|%e %b %Y, %H:%M %Z|agohover

I have discovered where the MAC address is stored in the bootloader. I compared the 'rescue.img' file from the rescue procedure to my own good harddrive. I found differences in 3 spots. The first difference (not surprisingly) is in the partition table of the MBR and is due to a disk size difference in the 4th partition. Look up MBR on wikipedia if you want to know more. The second difference is 4 bytes at (decimal) 24064. In the rescue.img file these bytes are C6 BF 52 3D. The 3rd difference is at (decimal) 24462 and is the ascii encoded MAC address. In the rescue.img, the ascii string value is "0x0090A915,0x9984". This corresponds to the MAC address 00:90:A9:15:99:84 which is what you will have after the rescue procedure. The problem is that you can't just change the ascii MAC address. You must also change the 4 bytes at 24064 and I don't yet see the relationship. If you get the two field out of sync you always end up with a MAC address of 00:30:E0:00:00:01. This is a default address registered to Oxford Semi, the makers of the chip in the MBWE. (The first 3 bytes of a MAC address are the Organizationally Unique Identifier. 00:30:E0 = Oxford Semi; 00:90:A9 = Western Digital.)

If it helps anyone figure out how this works, my MAC address is 00:90:A9:25:78:28 with a 4 byte code of A9 C5 35 56. If you want to see the values on your box, you can ssh in and do the following (as root):

dd if=/dev/sda bs=1 skip=24064 count=4 | od -x

dd if=/dev/sda bs=1 skip=24462 count=17 | od -c

Carl

unfold Re: MAC change after rescue procedure. by shemersshemers, 1211900529|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
The_SaintThe_Saint 1214196711|%e %b %Y, %H:%M %Z|agohover

It is possible to change it with ifconfig eth0 hw ether MAC

after restart its the old one again,how to make it permanent ?

Shemers have you found out how to change it back ?

Thanks

unfold Re: MAC change after rescue procedure. by The_SaintThe_Saint, 1214196711|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
servoservo 1221317434|%e %b %Y, %H:%M %Z|agohover

This procedure will change the Mac Address but It will have to run on every boot

I did the followin … Create the file in /root/macaddr.sh

ip link set eth0 down
ifconfig eth0 hw ether 00:90:A9:xx:xx:xx
ip link set eth0 up

Note: You must change xx:xx:xx for your original if you know it or you can set anyone you like

Then you have to makeit executable and also make a softlink to the ssh in the /etc/init.d/ so it will change it on every reboot

# chmod 755 /root/macaddr.sh
# ln -s /root/macaddr.sh /etc/init.d/S1macaddr.sh

I notice that the script can be execute on the fly… and you dont loose the conection.
so you can try it to see if it work.

to check your Mac Adrress

# ifconfig

Why I didn't make the file directly on /etc/init.d/ ?
in my case i brick two MyBook World. So i did this to keept all the things i need handy if I need them again.

last edited on 1221318697|%e %b %Y, %H:%M %Z|agohover by servo + show more
unfold Re: MAC change after rescue procedure. by servoservo, 1221317434|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
alephsmithalephsmith 1230943275|%e %b %Y, %H:%M %Z|agohover

I wonder if people could dump their boot loader and post it here so that those of us with multiple MBWEs can have a choice of more than one MAC.

I am about to restore a second drive any don't want to fiddle around with a init script to set my MAC.

unfold Re: MAC change after rescue procedure. by alephsmithalephsmith, 1230943275|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
jharris1993jharris1993 1238263048|%e %b %Y, %H:%M %Z|agohover

My data-point is this:
(hex) 2B 49 0E 2A
(asc) 0x00908945,0x41B3
(mac) 00:90:89:45:41:B3

The hex data is located at offset 0x5E00, and the ascii data is located at offset 5F8E

At offset 0x5E5F is located an ascii string representing the "default" MAC address: 00:30:e0:00:00:01
(note the "e" instead of "E")

I have not tried this, but it might be possible to hard-code the desired mac address by changing these bytes.

How to edit these bytes
A great way to do this (in Windows) is to download a copy of Ultra Edit - it functions as a fully capable HEX editor, among many other things.

Jim

unfold Re: MAC change after rescue procedure. by jharris1993jharris1993, 1238263048|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
ETMegabyteETMegabyte 1246308904|%e %b %Y, %H:%M %Z|agohover

I found differences in 3 spots. The first difference (not surprisingly) is in the partition table of the MBR and is due to a disk size difference in the 4th partition. Look up MBR on wikipedia if you want to know more. The second difference is 4 bytes at (decimal) 24064. In the rescue.img file these bytes are C6 BF 52 3D. The 3rd difference is at (decimal) 24462 and is the ascii encoded MAC address. In the rescue.img, the ascii string value is "0x0090A915,0x9984". This corresponds to the MAC address 00:90:A9:15:99:84 which is what you will have after the rescue procedure. The problem is that you can't just change the ascii MAC address. You must also change the 4 bytes at 24064 and I don't yet see the relationship.

Actually, in the rescue image, for mac address 00:90:a9:15:99:84, the 4 byte code *should* be BF C6 3D 52. I think you had them slightly out of order…

And your mac address of 00:90:a9:25:78:28 *should* have a 4 byte checksum of C5 A9 56 35. Again, I think you got them backwards.

I've tested both of these macs and their checksums, and this should be the proper checksum bytes for those two mac addresses.

-ET

last edited on 1246309183|%e %b %Y, %H:%M %Z|agohover by ETMegabyte + show more
unfold Re: MAC change after rescue procedure. by ETMegabyteETMegabyte, 1246308904|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
VidKoVidKo 1231909091|%e %b %Y, %H:%M %Z|agohover

In case you don't know: you can check your MAC address on a small sticker on the case.

unfold Re: MAC change after rescue procedure. by VidKoVidKo, 1231909091|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
jharris1993jharris1993 1238263490|%e %b %Y, %H:%M %Z|agohover

Yes, you can.

All you need is a high-powered magnifying glass to see the teeny-tiny digits… :-D

Jim

unfold Re: MAC change after rescue procedure. by jharris1993jharris1993, 1238263490|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
ETMegabyteETMegabyte 1245914319|%e %b %Y, %H:%M %Z|agohover

Actually, to read mine, I used a digital camera in "scan" mode (high quality, low compression), and then blew it up on my PC… My eyes are horrible (from working on PCs no doubt), so I needed to do that to see mine…

hehe

-ET

unfold Re: MAC change after rescue procedure. by ETMegabyteETMegabyte, 1245914319|%e %b %Y, %H:%M %Z|agohover
Restoring MAC address after Rescue
jharris1993jharris1993 1238292151|%e %b %Y, %H:%M %Z|agohover

I have added sections 2(a) and 4(a) which detail the way to save, and restore, the original MAC address - if still available.

Step 2(a)
Copy the 416 bytes of data located between offset address 0x5E00 and 0x5F9F.

dd if=/dev/sda of=./mac.bin bs=1 skip=24064 count=416

This creates a binary file - mac.bin - containing the 416 bytes of data that contain all the MAC address info (and some other stuff too that we don't really care about…)

Step 4(a)
Restore the 416 bytes of MAC address data after restoring rescue.img

dd if=./mac.bin of=/dev/sda bs=1 seek=24064

Jim

unfold Restoring MAC address after Rescue by jharris1993jharris1993, 1238292151|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
Hork68Hork68 1239377341|%e %b %Y, %H:%M %Z|agohover

This might or might not help but…….anyway =)

If you follow Step2(a) above and then open "mac.bin" with BVI or a comparable .BIN editor you can change your MAC Addr back to the original. Then just follow Step4(a) and your set.

Daniel

unfold Re: MAC change after rescue procedure. by Hork68Hork68, 1239377341|%e %b %Y, %H:%M %Z|agohover
Re: MAC change after rescue procedure.
ETMegabyteETMegabyte 1245914203|%e %b %Y, %H:%M %Z|agohover

This will not work. You can't just change the mac address. You have to change the corresponding checksum value (4 bytes at 0x5E00.

Another user on this forum believes he has found a way to calculate the checksum for any MAC address. We've tested it once, and it corrected an error on my part, so we think it works. Hopefully in the next couple of days he will publish that information…

-ET

unfold Re: MAC change after rescue procedure. by ETMegabyteETMegabyte, 1245914203|%e %b %Y, %H:%M %Z|agohover
New post
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License