Change MAC on Beaglebone Black with RTnet framework

Hello,

I got two Beaglebone Blacks. I am sending data from one BBB to the other BBB with the ping script.

For my real time framework there are some different commands.

My problem is:
When the BBB’s start up they do not have an Ethernet IP but a random MAC adress. Every time they start up they get a random MAC adress.

What I need to do that the “ping-script” works is the following:

rtifconfig rteth0 up 192.168.127.11 → just give one IP to one BBB
rtroute add dev rteth0 → tell your BBB which MAC belong to which IP
rtping

That is working fine. But i do not like to write these commands every time after start up. So I just integrate these comments in a script on the BBB’s which is executed while start up.
For changing the MAC address I use the command: rtifconfig rteth0 up hw ether .

If I change my MAC address and do the “rtifconfig” command everything looks great (MAC address changed).
But if I do the “rtroute add” command now the data will get lost. It’s like the MAC address has changed but not to the address I have just tipped in. If I want have a ping again, I need to restart BBB and let give them the random MAC from the script (I have tried to search the script giving that random MAC but did not find anything).

Can it be possible that it is changing the MAC to another one nevermind what I am tipping in?

Thanks.