how to keep udhcpc from setting the default route?
Alexander Griesser
alexander.griesser at lkh-vil.or.at
Wed Feb 18 14:40:51 UTC 2009
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Robert P. J. Day wrote:
> yup, that part i knew. currently, it's set to the (fairly
> predictable) /usr/share/udhcpc/default.script
Oh, yes, that was the path I didn't remember :) I have set it to
/bin/udhcpc.sh which is easier to remember for me. I did even write
the udhcpc.sh script on my own because the other one was a bit too
complicated for my basic needs.
>> The router variable ($router) is only set, if your DHCP lease
>> contains a router option,
>
> ah, that's what i'm after -- so you're saying that this is an option
> that can be set on the DHCP *server* side?
Of course, that's a DHCP scope option.
On Microsoft DHCP, it's in the "scope options" folder and is called
"003 Router"
Using dhcpd on Linux systems, it's a line like:
option routers 204.254.239.1;
in the scope.
>> 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.
As I said, that only works if you do not get the IP addresses for
both interfaces out of the same scope.
OK, it works, but you will have to create reservations for the specific
MAC addresses then to remove the router option from one of them.
> 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?
Yes.
> i can control that on only one of the subnets,
> 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.
Well, then remove the gateway option in the DHCP parameters on the
OpenWRT router and you should be good.
> obviously, a trivial solution is to change the default script, but i
> just wanted this to be more of a challenge. :-) so, as long as i've
> understood this correctly, now i'll just go see where on the linksys
> router i can configure the DHCP service scope option so that getting
> an IP address from that router doesn't end up setting the "router"
> variable, is that it? thanks.
Yes, that would be the solution.
ciao,
- --
Alexander Griesser (Netzwerkadministration)
E-Mail: alexander.griesser at lkh-vil.or.at | Web: http://www.lkh-vil.or.at
KABEG LKH Villach | Nikolaigasse 43 | 9500 Villach
Tel.: +43 4242 208 3061 | Fax.: +43 4242 208 971 2061
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iEYEARECAAYFAkmcHfMACgkQ66HVD6KUm1rDVQCglLqTDazYsP8J4or2I8b/aAG+
jMMAn3TX5KUwyePAo7J2mdmKYsEiq7dc
=cEiR
-----END PGP SIGNATURE-----
More information about the busybox
mailing list