[Bug 339] New: how do you set the metric for the route when ifup calls dhcp?

bugzilla at busybox.net bugzilla at busybox.net
Wed May 20 01:04:58 UTC 2009


https://bugs.busybox.net/show_bug.cgi?id=339

           Summary: how do you set the metric for the route when ifup calls
                    dhcp?
           Product: Busybox
           Version: 1.14.x
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: enhancement
          Priority: P3
         Component: Networking
        AssignedTo: unassigned at busybox.net
        ReportedBy: shawn.t.rutledge at gmail.com
                CC: busybox-cvs at busybox.net
   Estimated Hours: 0.0


I'm working on an embedded system which has both ethernet and wireless.  Using
a combination of busybox, ifplugd and dhcpcd for configuring it.  If you
connect to the Internet via one interface, then via the other, then disconnect
the first interface, you will end up with no default route.  That is because
the default route gets clobbered, and then dropped.

I can see in the source code (ifupdown.c) that the parameters to dhcpcd are
hard-coded, and don't include the -m parameter.

In the case of ethernet, ifplugd runs ifup, which runs dhcpcd.  In the case of
wireless, a startup script runs ifup, which runs dhcpcd.

dhcpcd has a -m flag for setting the metric, and I have confirmed that if I use
it manually, I get the desired behavior: there can be two default routes at the
same time, one has a higher priority, and if either interface gets
de-configured, the other interface's default route remains.

So it seems to me the best solution would be a way for ifup to give the -m flag
to dhcpcd when it runs it.  Maybe it should pay attention to an optional METRIC
specification in /etc/network/interfaces: if it is there, then give the -m
parameter to dhcpcd.  (and other dhcp clients might not support that, or might
support it in a different way)  I can probably write a patch for that, if you
think it is the right approach.

Is there a better solution?


-- 
Configure bugmail: https://bugs.busybox.net/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the busybox-cvs mailing list