how to stop wlan0 mac address randomization



  • I've noticed that every time the rb5 boots, the mac address for wlan0 interface changes. This is inconvenient, because I can't set the network router to reserve an IP address for it. Every time it boots, i have to use the adb shell to check what IP address ended up being assigned if i want to stream video or ssh to use vio and voa clients.
    I saw some forums like this one that said to change /etc/NetworkManager/NetworkManager.conf, but there's is no network manager directory in /etc directory.

    I tried creating /etc/NetworkManager/conf.d directory and adding a file there with the contents:


    [device]
    match-device=interface-name:wlan0
    wifi.scan-rand-mac-address=no


    but that didn't help.

    Any ideas for how to use a constant mac address?


  • Dev Team

    @shane_langhans Yes, this is a known issue. We have opened a support ticket with Qualcomm and are awaiting a solution.


  • Dev Team

    Hey @shane_langhans ,

    Yeah, this has been a pet peeve for me too. To officially fix it, we're waiting on QCOM for a proper fix.

    As a work around, do you have a range of IPs that are not being used in the router's DHCP pool? If so, maybe you can statically assign an IP within that range? For instance, you can setup service script that calls a script like this to set the IP:

    #!/bin/bash
    
    drone_IP='192.168.168.101'
    microhard_radio_gw='192.168.168.1'
    
    ifconfig eth0 down
    ifconfig eth0 $drone_IP netmask 255.255.255.0 up
    
    ip route add default via $microhard_radio_gw dev eth0
    

    See if this works, then we can drop it into a service like this in /etc/systemd/system:

    [Unit]
    After=sdsprpcd.service
    Requires=sdsprpcd.service
    
    [Service]
    Type=oneshot
    ExecStartPre=/bin/sleep 10
    ExecStart=/home/root/microhard_radio_config_iface.sh
    
    [Install]
    WantedBy=default.target
    


  • This post is deleted!

Log in to reply