Linux 网卡Mac地址绑定要点
网络在启动的时候需要去配置文件 /etc/udev/rules.d/70-persistent-net.rules 读取相应的信息,如:
[root@RHEL6U3X64 ~]# 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地址匹配的话就能正常开启网卡。
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。