首页
Profile
Profile
Profile
Profile
Profile

Ubuntu更换网卡MAC地址方法

2011-08-08 阅读 84
Debian与Ubuntu会自动记录网卡的MAC地址,更换网卡后,原来的网卡记录不会自动删除,还是会被设置为eth0,新的网卡自动设置为eth1,eth2... ``` vim /etc/udev/rules.d/内的(xx-)persistent-net.rules ``` ``` #PCI device 0x10de:0x00df (forcedeth) #SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*", ATTR{address}=="00:08:00:27:88:bb",ATTR{type}=="1",KERNEL=="eth*", NAME="eth0" #PCI device 0x10de:0x00df (forcedeth) SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*", ATTR{address}=="00:08:00:27:ac:89",ATTR{type}=="1",KERNEL=="eth*“, NAME=“eth1” ```

只要删除后面两行,将原来的第二行中的ATTR{address}后面的地址改为新的网卡的MAC地址,然后重新启动系统就可以了。

``` #PCI device 0x10de:0x00df (forcedeth) #SUBSYSTEM=="net",ACTION=="add",DRIVERS=="?*", ATTR{address}=="00:08:00:27:ac:89",ATTR{type}=="1",KERNEL=="eth*", NAME="eth0" ```

 

Ubuntu 网卡 MAC地址
更新于 2023年03月28日
 
陕ICP备13008705号-1 Chat Gpt Api