/etc/network/interfaces 中的條目順序

/etc/network/interfaces 中的條目順序

我有一個有兩個介面的設備,eth0 和 eth1。一個應該從 DHCP 伺服器取得其 IP,另一個應該靜態取得其 IP。

如果我的/etc/network/interfaces檔案配置如下:

auto lo
iface lo inet loopback

auto eth1
iface eth1 inet dhcp
iface eth1 inet6 auto

auto eth0
iface eth0 inet static
    address 10.10.10.10
    netmask 255.255.255.0

一切都很好,eth1 從 DHCP 伺服器取得其 IP,eth0 根據給定的資訊靜態設定其 IP,但如果我嘗試更改檔案中的順序,例如

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static
    address 10.10.10.10
    netmask 255.255.255.0

auto eth1
iface eth1 inet dhcp
iface eth1 inet6 auto

在這種情況下,eth1無法取得IP。

/etc/network/interface 是否關心每個接口的順序,以便管理員應該首先放置通過 DHCP 獲取 IP 的接口,然後放置靜態接口,或者我所做的配置中是否存在不同的錯誤?

相關內容