Hello;
Has anyone tried to change the mac address from the wifi interface (ra0
)? I have an Omega2+ and it's being kind of a pain to do it.
I tried it on the command line for both the wifi and the wired interfaces, using GNU macchanger
(installed from the LEDE repos) and I managed to only do it on the wired interface. The output for the command on ra0
is:
root@Omega-XXXX:~# macchanger -r ra0
Current MAC: 40:a3:6b:c0:XX:XX (unknown)
Permanent MAC: 00:00:00:00:00:00 (XEROX CORPORATION)
[ERROR] Could not change MAC: interface up or insufficient permissions: Not supported
Which is fair, given the interface is up and running. So I found this initscript and I tried running it on boot, to no avail; I even gave up doing it through uci. Then I did some messing around with it to randomize the addresses for all available interfaces on boot:
#!/bin/sh /etc/rc.common
START=13
STOP=80
# Mac-spoofer: spoofs the mac addresses on all interfaces
start() {
# All interfaces, except for the loopback
for interface in `ip a | grep '^\d' | grep -v '1: lo' | cut -d ' ' -f 2`; do
ip link set dev $interface down
macchanger -r $interface
ip link set dev $interface up
done
}
stop() {
for interface in `ip a | grep '^\d' | grep -v '1: lo' | cut -d ' ' -f 2`; do
ip link set dev $interface down
macchanger -p $interface
ip link set dev $interface up
done
}
As it turns out, on boot it catches both ra0
and eth0
, before the other interfaces are created and bound on them, still while they are both down. eth0
gets a random address every time, but ra0
doesn't:
root@Omega-XXXX:~# ip link
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN qlen 1
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UNKNOWN qlen 1000
link/ether 52:25:a7:76:64:6b brd ff:ff:ff:ff:ff:ff
3: ra0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel master br-wlan state UP qlen 1000
link/ether 40:a3:6b:c0:XX:XX brd ff:ff:ff:ff:ff:ff
4: br-wlan: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP qlen 1000
link/ether 52:25:a7:76:64:6b brd ff:ff:ff:ff:ff:ff
5: eth0.1@eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue master br-wlan state UP qlen 1000
link/ether 52:25:a7:76:64:6b brd ff:ff:ff:ff:ff:ff
6: apcli0: <BROADCAST,MULTICAST> mtu 1500 qdisc fq_codel state DOWNqlen 1000
link/ether 42:a3:6b:00:XX:XX brd ff:ff:ff:ff:ff:ff
root@Omega-XXXX:~# macchanger -p eth0
Current MAC: 40:a3:6b:c0:XX:XY (unknown)
Permanent MAC: 52:25:a7:76:64:6b (unknown)
[ERROR] Could not change MAC: interface up or insufficient permissions: Resource busy
Has anyone tried it, and found a way around it? Or is it the device/driver that does not support changing the mac address?
Thanks.