how to keep udhcpc from setting the default route?
Denys Vlasenko
vda.linux at googlemail.com
Thu Feb 19 00:28:42 UTC 2009
On Wednesday 18 February 2009 15:27, Robert P. J. Day wrote:
> On Wed, 18 Feb 2009, Alexander Griesser wrote:
> > so if you're getting two IP addresses on the same subnet on two
> > different physical interfaces (for whatever reasons) you need to
> > manually mark one interface as the primary interface and this can be
> > done with a one-line hack in udhcpc.sh.
>
> i can see that this can be done by hacking the default script
> trivially enough, but i was trying to do this without touching the
> script. and i believe you've given me the info i want.
My opinion is that you are on the wrong way to solve the problem.
The whole reason why udhcpc does not do any network config itself
but delegates it to the script is because the script can
and should be tweaked.
> > If you get IP addresses of two different subnets from two different
> > DHCP scopes you should think about removing the gateway from one of
> > the scope options if possible, that would get rid of this issue
> > automatically.
>
> this is *exactly* what's happening -- two totally different subnets,
> and you're saying that whether or not that "router" variable is set is
> a server-side option? i can control that on only one of the subnets,
But you should not. If your machine sits on two DHCP-controlled
networks at once, other machines very well may be only on one of them.
Thus both SHCP servers advertise default route suitable for such machines.
Your machine is unique, and thus your script should be more clever.
It should check availability of route from both networks.
If one is down, it's easy - use the other. If both are up,
well, have a priority or even set up more complicated
routing modes where both paths are used at once (never did it yet).
> which is serving DHCP via an openwrt-based linksys router and for
> which i am the admin. i can't touch the DHCP config on the other
> subnet -- that's a corporate net.
>
> obviously, a trivial solution is to change the default script, but i
> just wanted this to be more of a challenge. :-)
I wrote up my ideas regarding network config here:
http://busybox.net/~vda/no_ifup.txt
Please read, and feel free to disagree. :)
--
vda
More information about the busybox
mailing list