使用ethtool永久修改网卡MAC地址

偶然看到一篇文章在谈如何使用ethtool永久修改MAC地址,这里所谓的永久修改是指直接刷写进网卡的EEPROM,第一次见到这样子的操作,不知道是不是所有网卡都可以,手边也暂时没设备可以测试,先mark一下。

原文:How to permanently change a MAC address using ethtool

先引述原作者的警告,修改错误可能会变砖,在修改前一定要记得备份!

!! CAUTION !! Writing to the EEPROM of the network device could brick the device. Before you actually write to the EEPROM, you should backup the original EEPROM

TL;DR

备份:$ ethtool -e eth0 raw on > eeprom-backup.bin

写入:$ ethtool -E eth0 magic <N> offset <N> value <N>

详细步骤及内容请参阅作者原文以及ethtool的manual。


使用ethtool永久修改网卡MAC地址
https://blog.yrpang.com/posts/20682/
作者
yrPang
发布于
2020年11月3日
许可协议