我正在尝试使用
ifconfig wlan down
macchanger --random wlan
ifconfig wlan up
MAC 发生变化,但互联网停止工作。如果我尝试重新连接到 Wi-Fi 网络,互联网开始工作,但 MAC 会重置为默认值。
我该如何解决这个无稽之谈?
答案1
1)将代码块的内容保存到文件中.sh
。
2)然后,运行chmod +x what-you-called-it.sh
3)最后,你可以用sudo ./what-you-called-it.sh
#!/bin/bash
clear
printf "Stopping network service... "
service network-manager stop > /dev/null
echo "done"
sleep 1
printf "Bringing wlan0 down... "
sleep 1
ifconfig wlan0 down
echo "done"
sleep 1
printf "Changing MAC address... "
sleep 1
ifconfig wlan0 hw ether 00:11:22:33:44:55
echo "done"
sleep 1
printf "Bringing wlan0 up... "
sleep 1
ifconfig wlan0 up
echo "done"
sleep 1
printf "Starting network service... "
sleep 1
service network-manager start > /dev/null
echo "done"
echo