5.7.2. ifmetric 软件包

ifmetric 软件包使我们能够根据经验来维护路由度量值,即使是 DHCP 的路由度量值。

下面设置 eth0 接口的值,让其在有 wlan0 接口的情况下,更加适当。

  1. 安装 ifmetric 软件包。

  2. 在 “/etc/network/interfaces“ 里,增加一行 “metric 0“,紧挨着放在”iface eth0 inet dhcp“这行下面。

  3. 在 “/etc/network/interfaces“ 里,增加一行 “metric 1“ ,紧挨着放在 “iface wlan0 inet dhcp“ 这行下面.

metric 0 意味着最高路由优先级,是默认值。大的 metric 值意味着较低的路由优先级。具有最低 metric 值的活动的接口 IP 地址,成为原始路由。参见ifmetric(8)。