做实验的时候,克隆centos系统,发现克隆后eth0网卡启动不了。
解决方案:将eth0配置回来
修改/etc/udev/rules.d/70-persistent-net.rules文件
将PCI device 0x1022:0x2000 (vmxnet)用#注释,将PCI device 0x1022:0x2000 (vmxnet)中的eth2修改为eth0,记住MAC地址ATTR{address}=="00:0c:29:ab:c5:2c",退出保存。修改网卡配置文件/etc/sysconfig/network-scripts/ifcfg-eth0修改ip地址:IPADDR=192.168.0.102(因为我才用host-only的链接方式,所以是静态ip),修改MAC地址HWADDR=00:0C:29:AB:C5:2c,退出保存。修改/etc/sysconfig/network文件中主机名 HOSTNAME=hadoop2执行命令:service network restart,会出现eth0生效的提示信息。Bringing up interface eth0: Active connection state: activatingActive connection path: /org/freedesktop/NetworkManager/ActiveConnection/1state: activatedConnection activated最好reboot重启一下。
[root@hadoop2 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:AB:C5:2C inet addr:192.168.0.102 Bcast:192.168.0.255 Mask:255.255.255.0 inet6 addr: fe80::20c:29ff:feab:c52c/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:177 errors:0 dropped:0 overruns:0 frame:0 TX packets:61 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:17634 (17.2 KiB) TX bytes:7611 (7.4 KiB) Interrupt:19 Base address:0x2024