how to keep udhcpc from setting the default route?

Robert P. J. Day rpjday at crashcourse.ca
Wed Feb 18 13:51:53 UTC 2009


On Wed, 18 Feb 2009, Alexander Griesser wrote:

> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Robert P. J. Day wrote:
> >   long story short:  how to not have udhcpc add default entries to the
> > routing table.  obviously, i can manually remove those entries later,
> > but i checked the doc for "udhcpc" and i don't see an obvious option
> > that says, "don't set a default route."
> >
> >   do i just do that manually after invoking "udhcpc"?  or can i tuck
> > that away in the udhcpc "script" file that is run at DHCP events?
> > thanks.
>
> I would do that in the udhcpc.sh script. Depending on your
> configuration, this script might look like this:
>
> - --------------------- 8< ------------------
> [...]
> case $1 in
>   "bound" | "renew")
>         ifconfig $interface $ip netmask $subnet up
>         if [ "$router" != "" ]; then
>           route add default gw $router
>         fi
> [...]
> - --------------------- 8< ------------------
>
> As you can see, if a router option is given, it tries to set the
> default route to this option.

  potentially a dumb question but where is the "router" variable set
such that the udhcpc default script will be passed that value?  as it
is, i would like eth0 to add a default route entry, but not eth1.  so
how do i invoke udhcpc differently for those two interfaces?  or am i
missing something painfully obvious?  thanks.

rday
--

========================================================================
Robert P. J. Day
Linux Consulting, Training and Annoying Kernel Pedantry:
    Have classroom, will lecture.

http://crashcourse.ca                          Waterloo, Ontario, CANADA
========================================================================


More information about the busybox mailing list