As seen from upstream's response in #279741, ignoring IF_* is intentional, and
unlikely to be changed. Still, patch for ifupdown in #364581 to pass IF_METRIC
isn't applied after sitting there for almost four years, and in any case it
doesn't seem reasonable to special case dhclient in ifupdown. And yet metric
is mentioned in dhclient-script and it takes some time to realize why it isn't
working.
Therefore please consider either removing all mentions of metric from
dhclient-script, or applying the attached patch.
--
Vadim Solomin
diff -Naur dhcp3-3.1.3/debian/dhclient-script.linux dhcp3-3.1.3-new/debian/dhclient-script.linux
--- dhcp3-3.1.3/debian/dhclient-script.linux 2010-04-23 21:36:09.000000000 +0400
+++ dhcp3-3.1.3-new/debian/dhclient-script.linux 2010-04-23 21:57:45.093741849 +0400
@@ -128,6 +128,13 @@
fi
if [ -n "$IF_METRIC" ]; then
metric_arg="metric $IF_METRIC" # interfaces(5), "metric" option
+else
+ # As dhclient doesn't pass IF_* variables to dhclient-script,
+ # extract metric from it's environment.
+ set -- $(grep -z '^IF_METRIC=' /proc/$PPID/environ)
+ if [ -n "$1" ]; then
+ metric_arg="metric ${1#IF_METRIC=}"
+ fi
fi