There're old bug (eg bug #71929) but those don't seems to cover my issue. I tried to run macchanger in the preup() section of /etc/conf.d/net of my WLAN interface - but this never worked reliable. And using an own written udev rule also don't work reliable. What works is however to add few lines to /etc/init.d/net.lo: # by toralf # if [[ "$IFACE" = "wlp3s0" ]]; then /usr/bin/macchanger -A $IFACE fi # We up the iface twice if we have a preup to ensure it's up if # available in preup and afterwards incase the user inadvertently # brings it down /me wonders how to achieve the same with /etc/conf.d/net ? BTW there's a typo : "incase" -> "in case" back ground: https://forums.gentoo.org/viewtopic-t-1014838-highlight-.html https://forums.gentoo.org/viewtopic-t-1015264-highlight-macchanger.html
FWIW as advised in the forum I tried to add sleeps in /etc/conf.d/net, no success: # WLAN # config_wlp3s0="dhcp" preup(){ if [[ "$IFACE" = "wlp3s0" ]]; then #ifconfig $IFACE down #sleep 1 #macchanger -A $IFACE #ifconfig $IFACE up #sleep 5 : fi }
Created attachment 415696 [details] Fix net-misc/netifrc-0.2.2 (/lib/netifrc/net/macchanger.sh) for macchanger-1.7.0 net-misc/netifrc-0.2.2 (/lib/netifrc/net/macchanger.sh) macchanger -V GNU MAC changer 1.7.0 macchanger -a enp4s1 Current MAC: e8:cc:32:4a:53:d2 (Micronet LTD) Permanent MAC: 00:11:22:33:44:55 (Apple) New MAC: 50:ce:75:81:87:10 (Measy Electronics Ltd) Output of new macchanger changed, so we must change /lib/netifrc/net/macchanger.sh accordingly.
*** This bug has been marked as a duplicate of bug 547906 ***