网络在启动的时候需要去配置文件 /etc/udev/rules.d/70-persistent-net.rules 读取相应的信息,如:
[[email protected] ~]# 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 0x15ad:0x07b0 (vmxnet3)
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:0c:29:42:0f:aa", ATTR{type}=="1", KERNEL=="eth*", NAME="eth1"
SUBSYSTEM=="net", ACTION=="add", DRIVERS=="?*", ATTR{address}=="00:45:29:88:0f:aa", ATTR{type}=="1", KERNEL=="eth*", NAME="eth0"
表明在 setup 网络设置中设置了2个网卡: eth1和eth0,系统看到这个信息会自动去读取网卡对应的文件 etc/sysconfig/network-script/ifcfg-eth1和etc/sysconfig/network-script/ifcfg-eth0
如果Mac地址不匹配的话,用service network restart 后,有时就会得到如下的提示
Shutting down loopback interface: [ OK ]
Bringing up loopback interface: [ OK ]
Bringing up interface eth0: Error: No suitable device found: no device found for connection ' System eth0'.
[FAILED]
用ifconfig eth0 up 提示eth0: unknown interface: No such device
如果Mac地址匹配的话就能正常开启网卡。
转载于:https://blog.51cto.com/836874/1384259