转: 网卡名字eth0,eth1的修改方法
2017-04-25 14:55
387 查看
转自: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
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的情况下,
# 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"
为了避免MAC地址和其他虚拟机重复,我们可以选择更改下MAC地址,然后将eth0 eth1两行注释掉,将最后两行中的eth2 和eth3更改为eht0 和 eth1 。
完成后重启,就会发现虚拟机网卡又变成eth0和eth1了。
我使用这个方法生效:
现象:只有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
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的情况下,
# 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"
为了避免MAC地址和其他虚拟机重复,我们可以选择更改下MAC地址,然后将eth0 eth1两行注释掉,将最后两行中的eth2 和eth3更改为eht0 和 eth1 。
完成后重启,就会发现虚拟机网卡又变成eth0和eth1了。
相关文章推荐
- 网卡名字eth0,eth1的修改方法
- 网卡名字eth0,eth1的修改方法
- centos网卡eth1变成eth0修改方法
- centos克隆 网卡eth1变成eth0修改方法
- centos网卡eth1变成eth0修改方法
- centos网卡eth1变成eth0修改方法
- centos网卡eth1变成eth0修改方法
- vmware workstation中克隆后centos网卡eth1变成eth0修改方法
- Centos 6 克隆导致网卡eth0变成eth1、及修改网卡名的方法
- 修改eth0 eth1等名称的方法
- Linux下网卡eth1如何修改为eth0
- CentOS 7下修改默认网卡名为eth0的两种方法
- Linux下网卡eth1如何修改为eth0
- Linux网卡eth0变成eth1修改方法
- VMware克隆linux虚拟机后,克隆后的虚拟机如何把网卡eth1修改为eth0 ?
- Linux下网卡eth1如何修改为eth0
- VM 克隆的 centos 的Linux下网卡eth1如何修改为eth0解决办法
- centos6.3 网卡名字 em0修改为eth0
- linux 网卡的eth0变为eth1的解决方法
- Linux下网卡eth1如何修改为eth0