VMware啟動CentOS 6.5後將網卡eth1重新設定為eth0

來源:互聯網
上載者:User

標籤:vmbox eth0

在配置vmbox虛擬機器的時候,為了方便,經常採用複製虛擬機器的操作,但是複製後的虛擬機器即便採用了橋接網路的方式,還是無法正常串連區域網路


後來網上查了一下,可以重新設定eth

首先查看檔案 /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:0x100e (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:92:5e:f2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"# PCI device 0x8086:0x100e (e1000)SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:5a:00:b2", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"

記住eth1 中的mac地址 "08:00:27:5a:00:b2"

然後編輯檔案 vim /etc/sysconfig/network-scripts/ifcfg-eth0

DEVICE=eth1HWADDR=08:00:27:5a:00:b2TYPE=Ethernet#UUID=62b19c7b-4fbd-45ef-b73f-73d9bf664f69ONBOOT=yesNM_CONTROLLED=yesBOOTPROTO=staticIPADDR=192.168.102.6NETMASK=255.255.255.0GATEWAY=192.168.102.1

將原來的eth0,改為eth1,並將HWADDR修改該為上面檔案裡的mac地址

儲存退出後

重啟網路

service network restart

即可完成內網的聯通

測試輸入ifconfig斷行符號,如果能看到剛才檔案裡設定的ip,標示設定成功!


VMware啟動CentOS 6.5後將網卡eth1重新設定為eth0

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.