![在 /etc/network/interfaces 和 /etc/network/interfaces.d 中定义多个接口定义](https://linux22.com/image/1084229/%E5%9C%A8%20%2Fetc%2Fnetwork%2Finterfaces%20%E5%92%8C%20%2Fetc%2Fnetwork%2Finterfaces.d%20%E4%B8%AD%E5%AE%9A%E4%B9%89%E5%A4%9A%E4%B8%AA%E6%8E%A5%E5%8F%A3%E5%AE%9A%E4%B9%89.png)
eth0
是否有可能为中说/etc/network/interfaces.d/eth0.cfg
和中部分有一个接口定义/etc/network/interfaces
?
如果可能的话,优先权哪一个更胜一筹?
答案1
我的提示来自https://bugs.launchpad.net/ubuntu/+source/ifupdown/+bug/1235169。请参阅#1 评论。/etc/network/interfaces
然后您可以在下面看到/etc/network/interfaces.d
。
read_interfaces_defn(..., '/etc/network/interfaces'
Reading directory /etc/network/interfaces.d
Parsing file eth0
read_interfaces_defn(..., 'eth0') failed in directory '/root'
Parsing file eth1
read_interfaces_defn(..., 'eth1') failed in directory '/root'
Parsing file eth2
read_interfaces_defn(..., 'eth2') failed in directory '/root'
Parsing file eth3
read_interfaces_defn(..., 'eth3') failed in directory '/root'
Parsing file eth4
read_interfaces_defn(..., 'eth4') failed in directory '/root'
Parsing file lo
read_interfaces_defn(..., 'lo') failed in directory '/root'
run-parts --verbose /etc/network/if-pre-up.d
run-parts --verbose /etc/network/if-up.d
run-parts: executing /etc/network/if-up.d/000resolvconf
run-parts: executing /etc/network/if-up.d/ntpdate
run-parts: executing /etc/network/if-up.d/postfix
run-parts: executing /etc/network/if-up.d/upstart
也可以从这里的堆栈跟踪https://github.com/mitchellh/vagrant/issues/1092你可以看到它会抱怨重复。
/etc/network/interfaces:17: duplicate interface
ifup: couldn't read interfaces file "/etc/network/interfaces"