在 Linux 中,使用 ifconfig 修改 MAC 地址(俗称“MAC spoofing”)的一般步骤如下:
eth0(无线可能是 wlan0)00:11:22:33:44:55sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:11:22:33:44:55
sudo ifconfig eth0 up
ifconfig eth0 | grep ether
或
ip link show eth0
重启网卡通常会恢复:
sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 原MAC地址
sudo ifconfig eth0 up
或重启系统。
ifconfig 已逐步被弃用
ip 命令:sudo ip link set eth0 down
sudo ip link set eth0 address 00:11:22:33:44:55
sudo ip link set eth0 up
网络会短暂中断
某些驱动/网卡不支持改 MAC
不要用于非法用途(如蹭网、伪装攻击)
如果你愿意,可以告诉我:
我可以给你更精确的命令。