How to change the MAC address from a RAK2245?

Issue: can not registering the RAK2245 anymore on TTN

Setup: RPi 3B+

Server: 4.2.5R

Details:
Recently I deleted my account at TTN without removing my RAK2245 gateway.
Now I’m not able anymore to register my RAK2245 gateway.
As I understand correctly the gateway MAC address is used as device ID and now I’m looking for a way to change the MAC address of the RAK2245.

Does anyone know how to change that MAC address ?

Thanks in advance !

I see that the MAC address is in fact the one from the Raspberry Pi itself.
So if I swap the Pi for another one it schould be working wright ?

Hello @G33RT,
Welcome to the RAK forum.
What you can do besides changing the Pi is you can change the MAC used for creating that Gateway ID.
By default, the script is using the MAC of eth0 interface, and changing it to use the wlan0 interface’s MAC will give you a different Gateway ID.

You have to change this file and then start the script: rak_common_for_gateway/update_gwid.sh at master · RAKWireless/rak_common_for_gateway · GitHub

(if you are using the code from the git hub that I’ve shared you can find the file under /opt/ttn-gateway/packet_forwarder/lora_pkt_fwd)

Original :

iot_sk_update_gwid() {
    # get gateway ID from its MAC address to generate an EUI-64 address
    GATEWAY_EUI_NIC="eth0"
    if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then
        GATEWAY_EUI_NIC="wlan0"
    fi

Updated :

iot_sk_update_gwid() {
    # get gateway ID from its MAC address to generate an EUI-64 address
    GATEWAY_EUI_NIC="wlan0" #here is the change
    if [[ `grep "$GATEWAY_EUI_NIC" /proc/net/dev` == "" ]]; then
        GATEWAY_EUI_NIC="wlan0"
    fi

After you save the file just start it with this command:
sudo ./update_gwid.sh local_conf.json

Best Regards

Thanks for the help.

However I read your message just an bit too late :grinning:
I discovered that if I like to change the eth0 MAC address I can do this also in the set_eui.sh file.

GATEWAY_EUI=$(ip link show $GATEWAY_EUI_NIC | awk ‘/ether/ {print $2}’ | awk -F: ‘{print $1$2$3"FFFE"$4$5$6}’)

I can change the “FFFE” lets say to “FFFF
The MAC result would be “A1 A2 A3 FF FE B1 B2 B3” into this “A1 A2 A3 FF FF B1 B2 B3” which is a new MAC address.