转: 网卡名字eth0,eth1的修改方法
生活随笔
收集整理的這篇文章主要介紹了
转: 网卡名字eth0,eth1的修改方法
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
轉自:http://longwind.blog.51cto.com/419072/982738 我使用這個方法生效: 現象:只有eth2, vi?/etc/udev/rules.d/70-persistent-net.rules ? 把我機器eth0,1 注釋掉, 然后把 ?eth2 的一行信息改為 eth1, 然后 reboot.? 網卡名字eth0,eth1的修改方法 2012-09-05 15:40:14 標簽:網卡?虛擬機?配置文件?eth0 原創作品,允許轉載,轉載時請務必以超鏈接形式標明文章?原始出處?、作者信息和本聲明。否則將追究法律責任。http://longwind.blog.51cto.com/419072/982738 #?vi?/etc/udev/rules.d/70-persistent-net.rules ? ? 其中會有 ? #?PCI?device?0x8086:0x100f?(e1000)?(custom?name?provided?by?external?tool) ? SUBSYSTEM=="net",?ACTION=="add",?DRIVERS=="?*",?ATTR{address}=="00:0c:29:42:e7:61",?ATTR{type}=="1",?KERNEL=="eth*",?NAME="eth0"? ? #?PCI?device?0x8086:0x100f?(e1000) ? SUBSYSTEM=="net",?ACTION=="add",?DRIVERS=="?*",?ATTR{address}=="00:0c:29:42:e7:66",?ATTR{type}=="1",?KERNEL=="eth*",?NAME="eth1"? ? #?PCI?device?0x8086:0x100f?(e1000)?(custom?name?provided?by?external?tool) ? SUBSYSTEM=="net",?ACTION=="add",?DRIVERS=="?*",?ATTR{address}=="00:0c:29:42:e7:6c",?ATTR{type}=="1",?KERNEL=="eth*",?NAME="eth2"? ? #?PCI?device?0x8086:0x100f?(e1000) ? SUBSYSTEM=="net",?ACTION=="add",?DRIVERS=="?*",?ATTR{address}=="00:0c:29:42:e7:76",?ATTR{type}=="1",?KERNEL=="eth*",?NAME="eth3"?
VMWARE安裝虛擬機后,為了避免重新安裝,一般會選擇直接復制虛擬機,但當打開心得拷貝后網卡信息會變化,原來是eth0 eth1 就會變成eth2 eth3,如果不想使用eth2 eth3下面的方法就可以更改網卡名稱。CentOS為例
1.使用ip link 命令
ip link set eth0 name eth2
ip link set eth1 name eth0
ip link set eth2 name eth1
即可隨意更改名字,不過重啟后會失效。
2.更改配置文件(重啟不會失效)
直接可以在modprobe 中修改模塊別名,如使用udev的情況下,
?
?
為了避免MAC地址和其他虛擬機重復,我們可以選擇更改下MAC地址,然后將eth0 eth1兩行注釋掉,將最后兩行中的eth2 和eth3更改為eht0 和 eth1 。
完成后重啟,就會發現虛擬機網卡又變成eth0和eth1了。
轉載于:https://www.cnblogs.com/jhj117/p/6762120.html
總結
以上是生活随笔為你收集整理的转: 网卡名字eth0,eth1的修改方法的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: ubuntu 16.0.4 配置 ten
- 下一篇: 批处理(定时器) ssm spring-