[pkg-dhcp-devel] Bug#676323: Regression: Does not configure multiple default routes

Joachim Breitner nomeata at debian.org
Wed Jun 6 07:57:22 UTC 2012


Hi,

Am Mittwoch, den 06.06.2012, 09:22 +0200 schrieb Joachim Breitner:
> I hope you can tell from the description what change trigged this and
> how to fix it (or at least how to configure my system to work as
> before).

some more information. After adding -x to /sbin/dhclient-script I notice
that 
        ip -4 route add default via 141.3.176.254 dev wlan0
_is_ indeed called, but has no effect:

$ route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         141.3.44.254    0.0.0.0         UG    0      0        0 eth0
10.254.1.0      0.0.0.0         255.255.255.0   U     0      0        0 ehbuehl0
141.3.44.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
141.3.176.0     0.0.0.0         255.255.254.0   U     0      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
$ ip -4 route add default via 141.3.176.254 dev wlan0
RTNETLINK answers: File exists
$ route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         141.3.44.254    0.0.0.0         UG    0      0        0 eth0
10.254.1.0      0.0.0.0         255.255.255.0   U     0      0        0 ehbuehl0
141.3.44.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
141.3.176.0     0.0.0.0         255.255.254.0   U     0      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
$ route add default gw 141.3.176.254 dev wlan0
$ route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         141.3.176.254   0.0.0.0         UG    0      0        0 wlan0
0.0.0.0         141.3.44.254    0.0.0.0         UG    0      0        0 eth0
10.254.1.0      0.0.0.0         255.255.255.0   U     0      0        0 ehbuehl0
141.3.44.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
141.3.176.0     0.0.0.0         255.255.254.0   U     0      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0
$ route del default gw 141.3.176.254 dev wlan0
$ ip -4 route add default via 141.3.176.254 dev wlan0 metric 1
$ route -n
Kernel-IP-Routentabelle
Ziel            Router          Genmask         Flags Metric Ref    Use Iface
0.0.0.0         141.3.44.254    0.0.0.0         UG    0      0        0 eth0
0.0.0.0         141.3.176.254   0.0.0.0         UG    1      0        0 wlan0
10.254.1.0      0.0.0.0         255.255.255.0   U     0      0        0 ehbuehl0
141.3.44.0      0.0.0.0         255.255.255.0   U     0      0        0 eth0
141.3.176.0     0.0.0.0         255.255.254.0   U     0      0        0 wlan0
169.254.0.0     0.0.0.0         255.255.0.0     U     1000   0        0 eth0


As you can see, the good old “route” command does set up a new route.
Also, “ip” works if a metric is given. Judging from the script, I should
be able to set a metric with IF_METRIC, but that does not work:
$ export IF_METRIC=1
$ dhclient -1 -v -pf /run/dhclient.wlan0.pid -lf /var/lib/dhcp/dhclient.wlan0.leases wlan0 2>&1|egrep -i metric\|ip\ -4
+ ip -4 addr add 141.3.177.82/255.255.254.0 broadcast 141.3.177.255 dev wlan0 label wlan0
+ if_metric=
+ ip -4 route add default via 141.3.176.254 dev wlan0

Why the the variable not visible in dhclient-script? I have had the
setting “metric 1” in my wlan0 stanca in /etc/network/interfaces, so it
is possible that some change in dhclient prevented the environment
variable to be visible in the script environment and thus broke setting
up multiple routes.

Looking further I see that dhclient does set up an explicit argument for
the script and only includes stuff that has been passed via "-e", which
the current ifupdown code does not. Did it before? It did a long time
ago (see #235993), but that does not explain the recent breakage here.

I’m CC’ing ifupdown at p.d.o, as maybe a change in ifupdown caused this
(although I don’t see anything in the changelog).

Greetings,
Joachim

PS: 
I looked at installing ifmetric (as suggested in some very old
bugreport, #300987) but it does not help; it will only _change_ metrics
of existing routes, which does not help here, as the route is not even
created in the first place.
-- 
Joachim "nomeata" Breitner
Debian Developer
  nomeata at debian.org | ICQ# 74513189 | GPG-Keyid: 4743206C
  JID: nomeata at joachim-breitner.de | http://people.debian.org/~nomeata
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part
URL: <http://lists.alioth.debian.org/pipermail/pkg-dhcp-devel/attachments/20120606/56d7d50c/attachment.pgp>


More information about the pkg-dhcp-devel mailing list