Linux虛擬機器網絡卡改名方法

2021-06-26 16:49:41 字數 1201 閱讀 9809

因為虛擬機器的配置是需要通過其他初始化指令碼來生成的,所以網絡卡的裝置名不能改變,如果需要把eth3修改為eth0

以rhel6為例,把以下檔案作修改如下:

1、把eth0 ,eth1 ,eth2的相關行刪除掉

2、把eth3的相關行保留,並把eth3改為eth0即可。

[root@ovm0246 ~]# vim/etc/udev/rules.d/70-persistent-net.rules 

# this file was automatically generated bythe/lib/udev/write_net_rules

# program, run by thepersistent-net-generator.rules rules file.

# you can modify it, as long as you keepeach rule on a single

# line, and change only the value of thename= key.

# pci device 0x10ec:0x8139 (8139cp) (customname provided by external tool)

subsystem=="net",action=="add", drivers=="?*",attr=="52:54:00:12:34:56", attr=="1",kernel=="eth*", name="eth0"

# pci device 0x10ec:0x8139 (8139cp)

subsystem=="net",action=="add", drivers=="?*",attr=="02:00:c0:a8:14:f9", attr=="1",kernel=="eth*", name="eth1"

# pci device 0x10ec:0x8139 (8139cp)

subsystem=="net",action=="add", drivers=="?*",attr=="52:54:00:e4:d4:1d", attr=="1",kernel=="eth*", name="eth2"

# pci device 0x10ec:0x8139 (8139cp)

subsystem=="net",action=="add", drivers=="?*",attr=="02:00:c0:a8:14:fa", attr=="1",kernel=="eth*", name="eth3"

kvm 基礎 虛擬機器改名

1 檢視所有的kvm虛擬機器 2 重新命名kvm虛擬機器最好是將虛擬機器先關機,然後再匯出其xml檔案 root 5201351 kvm cd etc libvirt qemu root 5201351 kvm qemu virsh dumpxml kvm client00 kvm 00.xml 3...

Linux 關於虛擬機器的網絡卡

因為虛擬機器中網路,我們一般都是和公司的其他伺服器是同乙個網段,所以我們需要把kvm伺服器的網絡卡配置成橋接模式。這樣的話kvm的虛擬機器就可以通過該橋接網絡卡和公司內部分其他伺服器處於同一網段。其實我們在虛擬機器搭建的時候,我們最終關心的網絡卡是 eth0,br0,vnet0,vnet1 其中et...

linux之網絡卡安裝虛擬機器

一 配置預安裝環境 關火牆!yum install dhcp systemctl start dhcpd cp usr share doc dhcp 4.2.5 dhcpd.conf example etc dhcp dhcpd.conf vim etc dhcp dhcpd.conf 刪改 在se...