RedHat 6 VMware轉殖後網絡卡修改方法

2021-06-11 20:28:17 字數 1802 閱讀 7426

通常為了節省時間,在vmware中安裝一套linux後,會直接轉殖乙份出來使用。但在轉殖redhat 6後,會發現網絡卡名稱發生變化,比如eth0會變為eth1,下面介紹下轉殖後的redhat 6,如何修改主機名、ip位址和網絡卡名稱。

修改主機名(共2步)

hostname amto02

vi /etc/sysconfig/network -> 修改項:hostname=amto02

還原網絡卡名稱為eth0:

[root@amto02 u01]# cat /etc/udev/rules.d/70-persistent-net.rules.bak 

# this file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

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

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

# pci device 0x8086:0x100f (e1000) (custom name provided by external tool)

subsystem=="net", action=="add", drivers=="?*", attr=="00:0c:29:27:be:dc", attr=="1", kernel=="eth*", name="eth0"

# pci device 0x8086:0x100f (e1000)

subsystem=="net", action=="add", drivers=="?*", attr=="00:0c:29:8a:8d:19", attr=="1", kernel=="eth*", name="eth1"

在該配置檔案中會發現存在2條記錄,第二條記錄是轉殖/複製虛擬機器後,重新生成的乙個mac位址(00:0c:29:8a:8d:19),因此,需要把就配置刪除掉,也就是將第1條記錄刪除。並且第2條記錄的最後面,將eth1改為eth0。修改後的配置檔案為:

[root@amto02 u01]# cat /etc/udev/rules.d/70-persistent-net.rules

# this file was automatically generated by the /lib/udev/write_net_rules

# program, run by the persistent-net-generator.rules rules file.

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

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

# pci device 0x8086:0x100f (e1000)

subsystem=="net", action=="add", drivers=="?*", attr=="00:0c:29:8a:8d:19", attr=="1", kernel=="eth*", name="eth0"

執行setup或者system-config-network,按照提示填寫新的ip資訊即可。

重啟網絡卡服務:

service networkmanager restart

service network restart

vmware轉殖主機

因為準備搭建伺服器集群,但是乙個個虛擬機器的建立過於繁瑣,因此使用轉殖來減少工作量。開啟vmware,進入主介面,點選虛擬機器選項 點選轉殖 轉殖完成。解決方法 登陸進入剛轉殖的主機 輸入賬號密碼,我安裝的是最小化的centos 輸入命令 vim etc udev rules.d 70 persis...

Linux系統 VMware轉殖

轉殖vmware 1 關閉防火牆 2 關閉 selinux 3 刪除 uuid 和mac 位址4 清空網絡卡快取 5 關機 關閉防火牆 service iptables stop chkconfig iptables off 關閉selinux setenforce 0 vim etc syscon...

vmware轉殖Centos6 網絡卡無法啟動

原因是以下三處mac位址不一致 1 使用dmesg grep eth,獲得eth編號和mac位址 2 cat etc udev rules.d 70 persistent net.rules 3 cat etc sysconfig network scripts ifcfg eth0 處理辦法1 修...