在使用NetworkManager的Ubuntu 10.04每次重启时,我都能获得随机的MAC地址。我现在已经升级到18,04,并且发生了一些变化,脚本不再起作用。 界面已更新,什么也没有。
sudo nano /etc/init/macchanger.conf
# macchanger - set MAC addresses
#
# Set the MAC addresses for the network interfaces.
description "change mac addresses"
start on starting network-manager
pre-start script
/usr/bin/macchanger -A wlan0
/usr/bin/macchanger -A eth0
/usr/bin/macchanger -A wmaster0
/usr/bin/macchanger -A pan0
#/usr/bin/logger wlan0 `/usr/bin/macchanger -s wlan0`
#/usr/bin/logger eth0 `/usr/bin/macchanger -s eth0`
end script
and then sudo nano /etc/network/if-post-down.d/random-mac
#!/bin/sh
MACCHANGER=/usr/bin/macchanger
[ "$IFACE" != "lo" ] || exit 0
# Bring down interface (for wireless cards that are up to scan for networks),
change MAC address to a random vendor address, bring up the interface
/sbin/ifconfig "$IFACE" down
macchanger -A "$IFACE"
Made the random-mac script executable by typing:
sudo chmod +x /etc/network/if-post-down.d/random-mac
Restart Network Manager to take effect:
sudo service network-manager restart
没有错误消息,只是没有变化