镜像:CentOS-6.4-i386-minimal.iso
安装好后进入系统(是想配置虚拟机里的CentOS既可以和主机互联,同时也可以连上外网),
使用ping时,错误:
network is unreachable
service network restart时,错误:
Device eth0 does not seem to be present.
开始也是碰上了这些错误提示,
--------------------
自己记录下...
查看配置的上图的mac地址 是否与 文件中的ATTR[address]对应上.
如果不对应可以选择删除该文件重启,也可以直接修改该文件
[root@localhost network-scripts]# 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:0x100e (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:e2:c7:25", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1" # PCI device 0x8086:0x100e (e1000) SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="08:00:27:bb:f0:79", ATTR{type}=="1", KERNEL=="eth*", NAME="eth2"
该文件的DEVICE,HWADDR 应该与/etc/udev/rule.d/70-persistent-net.rules中的eth1一致.
我的ifcfg-eth0 文件,修改后为:
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth1 HWADDR=08:00:27:E2:C7:25 TYPE=Ethernet UUID=459bb09f-ce67-4276-a510-371dc8b8a12e ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp
该文件的DEVICE,HWADDR 应该与/etc/udev/rule.d/70-persistent-net.rules中的eth2一致.
我的ifcfg-eth1 文件,修改后为:
[root@localhost network-scripts]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth2 HWADDR=08:00:27:BB:F0:79 TYPE=Ethernet UUID=459bb09f-ce67-4276-a510-371dc8b8a12e ONBOOT=yes NM_CONTROLLED=yes BOOTPROTO=dhcp
-----------------------
执行ifconfig命令,输出
[root@localhost network-scripts]# ifconfig eth1 Link encap:Ethernet HWaddr 08:00:27:E2:C7:25 inet addr:192.168.56.103 Bcast:192.168.56.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:fee2:c725/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:924 errors:0 dropped:0 overruns:0 frame:0 TX packets:500 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:90940 (88.8 KiB) TX bytes:80641 (78.7 KiB) eth2 Link encap:Ethernet HWaddr 08:00:27:BB:F0:79 inet addr:10.0.3.15 Bcast:10.0.3.255 Mask:255.255.255.0 inet6 addr: fe80::a00:27ff:febb:f079/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:5 errors:0 dropped:0 overruns:0 frame:0 TX packets:13 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:1066 (1.0 KiB) TX bytes:1145 (1.1 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)