网卡有时会被识别为 eth0, 有时会被识别为 eth1, 这打乱了 shell script. 请问如何控制它让系统识别为 eth0 或 eth1; 或者如何知道系统将其识别成了 eth0 还是 eth1( 查看 ifcfg-eth0 或 ifcfg-eth1 是否存在有时不准确, 因为这些文件是可以被修改的).
我把 HWADDR 加入到 ifcfg-eth0 里了, 但 ifconfig 出来还是 eth1.
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
RHEL系,可以在 /etc/udev/rules.d/60-net.rules
Ubuntu系,可以在 /etc/udev/rules.d/70-persistent-net.rules
其他发行版应该都类似。