通过 ifconfig 命令
# 修改MAC地址 ifconfig eth0 hw ether 02:01:02:03:04:08 # 查看修改后的结果 ifconfig eth0
有关ifconfig命令,查看ifconfig(8)手册
通过 ip link 命令
# 修改MAC地址 ip link set eth0 address 02:01:02:03:04:08 # 查看修改后的结果 ip link ls eth0 ip addr ls eth0
有关ip命令的使用方法,查看ip(8)手册。
通过 macchanger 命令
Change mac address with macchanger Linux command
# 修改MAC地址 macchanger -m b2:aa:0e:56:ed:f7 eth0 # 查看修改结果,这里不再演示
有关macchanger命令的使用方法,查看macchanger(1)手册。
参考文献
Changing Your MAC Address/Linux