#2015-04-21 17:00环境:CentOS 6.4 x86_64 一、问题描述:在vmware上装有一台CentOS 6.4 x86_64的机器,本身有一块网卡,现有需求,需添加一块网卡做内部网使用。步骤:在vmware的CentOS 设置中添加一块网卡,并放在VMNet2中,成功添加,而且vmware 右下角也有两块网卡并且都处于连接状态。重启CentOS 数次,用ifconfig 查看,始终只有eth0没有eth1,用ls /etc/sysconfig/network-scripts/ifcfg-eth* 查看,始终只有ifcfg-eth0,没有ifcfg-eth1。二、解决方法:cat /etc/udev/rules.d/70-persistent-net.rules |grep ethSUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e9:f8:ad", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:e9:f8:b7", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"从上可以看出,CentOS的网卡名称和MAC地址,此时我们可以做下列操作,cp -p /etc/sysconfig/network-scripts/ifcfg-eth0 /etc/sysconfig/network-scripts/ifcfg-eth1vim /etc/sysconfig/network-scripts/ifcfg-eth1
####
DEVICE=eth1 //eth0 -> eth1
HWADDR=00:0C:29:E9:F8:B7 //00:0C:29:E9:F8:AD -> 00:0C:29:E9:F8:B7TYPE=EthernetUUID=f48e3f26-996d-4f6d-b0fc-7487435b160bONBOOT=yesNM_CONTROLLED=noBOOTPROTO=staticIPADDR=10.10.10.254NETMASK=255.255.255.0DNS1=223.5.5.5DNS2=208.67.222.222####/etc/init.d/network restart 用ifconfig来测试,则发现有网卡eth1了。三、总结/etc/sysconfig/network-scripts/ifcfg-eth? 与 /etc/udev/rules.d/70-persistent-net.rules 的内容有关。