--------------------------------------shell
1、強迫症緣由bash
2、正常配置eth1網卡網絡
3、修改網卡名稱eth1爲eth0ide
--------------------------------------工具
1、強迫症緣由oop
因爲使用VMware workstation克隆虛機時,網卡名稱老是變化,再也不是eth0,這點總感受不太舒服,雖然能夠正常使用,可是強迫症很是嚴重,必須是eth0,看着才舒服!spa
2、正常配置eth1網卡 3d
因爲初次打開克隆的虛機後沒有配置IP,因此不能使用Xshell鏈接,也沒有安裝桌面,只能截圖了。orm
1.克隆的系統初次開機時網卡是未激活狀態,須要先激活一下,且能夠看出是沒有eth0網卡的。blog
2.激活網卡eth1
查看網卡詳情
# setup //可使用此命令配置網卡IP,如下截圖有省略。
選擇添加新的設備
添加eth1網卡信息
保存退出便可
4.重啓網絡服務,eth1能夠正常使用了。
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)
3、修改網卡名稱eth1爲eth0
1.將系統中的eth0配置文件刪除,並將現有的eth1命名爲eth0。
# cd /etc/sysconfig/network-scripts/ # rm -f ifcfg-eth0 # mv ifcfg-eth1 ifcfg-eth0 # vi ifcfg-eth0 DEVICE=eth0 //將eth1修改成eth0 BOOTPROTO=none NETMASK=255.255.255.0 TYPE=Ethernet HWADDR=00:0c:29:60:15:0f IPADDR=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)