使用vmware複製CentOS後網卡名稱修改(強迫症)

來源:互聯網
上載者:User

標籤:eth1   eth0   網卡   

--------------------------------------

一、強迫症原因

二、正常配置eth1網卡

三、修改網卡名稱eth1為eth0

--------------------------------------


一、強迫症原因

    由於使用VMware workstation複製虛機時,網卡名稱總是變化,不再是eth0,這點總感覺不太舒服,雖然可以正常使用,但是強迫症非常嚴重,必須是eth0,看著才舒服!


二、正常配置eth1網卡  

由於初次開啟複製的虛機後沒有配置IP,所以不能使用Xshell串連,也沒有安裝案頭,只能了。

1.複製的系統初次開機時網卡是未啟用狀態,需要先啟用一下,且可以看出是沒有eth0網卡的。

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/58/98/wKioL1S1IEDQUq87AADOXSsLG94270.jpg" title="無標題3.png" style="float:none;" alt="wKioL1S1IEDQUq87AADOXSsLG94270.jpg" />

2.啟用網卡eth1

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/58/9B/wKiom1S1H3ezf6fuAABjU8YyEo8045.jpg" title="無標題4.png" style="float:none;" alt="wKiom1S1H3ezf6fuAABjU8YyEo8045.jpg" />

查看網卡詳情

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/58/9B/wKiom1S1H3ajX64nAAH4Qp8QwOI831.jpg" style="float:none;" title="無標題0.png" alt="wKiom1S1H3ajX64nAAH4Qp8QwOI831.jpg" />


3.正常配置eth1網卡

# setup       //可以使用此命令配置網卡IP,以下有省略。

選擇添加新的裝置

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/58/98/wKioL1S1IEHx3DHMAAB3ajXlJcQ874.jpg" style="float:none;" title="無標題5.png" alt="wKioL1S1IEHx3DHMAAB3ajXlJcQ874.jpg" />


650) this.width=650;" src="http://s3.51cto.com/wyfs02/M00/58/9B/wKiom1S1H3eifSVOAAB-h_tWqoY771.jpg" style="float:none;" title="無標題6.png" alt="wKiom1S1H3eifSVOAAB-h_tWqoY771.jpg" />

添加eth1網卡資訊

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/58/98/wKioL1S1IEHzMvvHAAEI08hQaHw593.jpg" style="float:none;" title="無標題7.png" alt="wKioL1S1IEHzMvvHAAEI08hQaHw593.jpg" />

儲存退出即可

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M01/58/9B/wKiom1S1H3fRqw0IAAB9m-_DBWk456.jpg" style="float:none;" title="無標題8.png" alt="wKiom1S1H3fRqw0IAAB9m-_DBWk456.jpg" />

4.重啟網路服務,eth1可以正常使用了。

650) this.width=650;" src="http://s3.51cto.com/wyfs02/M02/58/98/wKioL1S1IEGhieiBAADap0wm8PM469.jpg" style="float:none;" title="無標題9.png" alt="wKioL1S1IEGhieiBAADap0wm8PM469.jpg" />

5.此時可以使用Xshell工具串連了,不再了,貼命令。

# ifconfig eth1      Link encap:Ethernet  HWaddr 00:0C:29:60:15:0F            inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0          inet6 addr: fe80::20c:29ff:fe60:150f/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:60 errors:0 dropped:0 overruns:0 frame:0          TX packets:67 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:6219 (6.0 KiB)  TX bytes:10975 (10.7 KiB)lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:16436  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)

三、修改網卡名稱eth1為eth0

1.將系統中的eth0設定檔刪除,並將現有的eth1命名為eth0。

# cd /etc/sysconfig/network-scripts/# rm -f ifcfg-eth0# mv ifcfg-eth1 ifcfg-eth0# vi ifcfg-eth0DEVICE=eth0               //將eth1修改為eth0BOOTPROTO=noneNETMASK=255.255.255.0TYPE=EthernetHWADDR=00:0c:29:60:15:0fIPADDR=192.168.2.100

2.將設定檔中的第一個device刪除,第二個device的名稱修改為eth0即可。MAC地址要和網卡設定檔中的保持一致。

# cd /etc/udev/rules.d/# vi 70-persistent-net.rules          //未修改狀態  # PCI device 0x8086:0x100f (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:69:90:83", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x8086:0x100f (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:60:15:0f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"# cat 70-persistent-net.rules          //修改後狀態# PCI device 0x8086:0x100f (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:60:15:0f", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"

3.重啟系統後查看。

# reboot# ifconfig eth0      Link encap:Ethernet  HWaddr 00:0C:29:60:15:0F            inet addr:192.168.2.100  Bcast:192.168.2.255  Mask:255.255.255.0          inet6 addr: fe80::20c:29ff:fe60:150f/64 Scope:Link          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1          RX packets:29 errors:0 dropped:0 overruns:0 frame:0          TX packets:44 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:1000           RX bytes:3655 (3.5 KiB)  TX bytes:5385 (5.2 KiB)lo        Link encap:Local Loopback            inet addr:127.0.0.1  Mask:255.0.0.0          inet6 addr: ::1/128 Scope:Host          UP LOOPBACK RUNNING  MTU:16436  Metric:1          RX packets:0 errors:0 dropped:0 overruns:0 frame:0          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0          collisions:0 txqueuelen:0           RX bytes:0 (0.0 b)  TX bytes:0 (0.0 b)


本文出自 “一諾千金” 部落格,請務必保留此出處http://hatech.blog.51cto.com/8360868/1603696

使用vmware複製CentOS後網卡名稱修改(強迫症)

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.