[ Next-in-Thread ]  [ Next Message ] 

Question: route add unnecessary for dhclient? 

Forum: PCMCIA Network Adapter Issues
Date: 2000, Feb 24
From: Adam Goode <goodea@rpi.edu>

On line 60 of etc/network, there is the line

/sbin/route add default dev $DEVICE

which presumably adds the current device as the default gateway, when dhcp is enabled.

When I insert my 3com ethernet card, configured as a static interface in network.opts, it works properly as default route. When I plug in my wavelan card, it takes over as default route, which means it knocks out default route for the ethernet, and makes it go over the wavelan. Right now, I am not near a access point, so dhclient finds nothing on the wavelan and goes to sleep. But the card is configured as default route, which I don't want. When I comment out the route add line in etc/network, it works correctly. Is the line necessary? Doesn't dhclient automatically add the route as necessary? Seems like it, check out /etc/dhclient-script.

I am running Debian woody on x86.

Adam Goode

[ Next-in-Thread ]  [ Next Message ] 

Messages Inline: [ 0 ]  [ 1 ] 

I'm not sure

Re: Question: route add unnecessary for dhclient? (Adam Goode)
Date: 2000, Feb 24
From: David Hinds <dhinds@pcmcia.sourceforge.org>

I believe that the route command was necessary at one time, for at
least some versions of dhcpcd and/or kernels, but I don't know if it
is/was ever necessary for dhclient.

Where do you get dhclient, anyway?  I've never been able to find a
dhclient package that wasn't for BSD.  Maybe it doesn't matter, but
network configuration scripts tend to be platform specific.

-- Dave

Feedback: dhclient for Linux

Re: I'm not sure (David Hinds)
Date: 2000, Feb 24
From: Adam Goode <goodea@rpi.edu>

Well, on Debian potato (or woody), dhclient is right there, as a package to install in dselect. It's interesting the way dhclient works in handling cross-platform issues. The binary itself does only platform independent things. Most of the platform specific implementation stuff is in /etc/dhclient-script, which is customized for your platform.

In that file, route is definitely called (correctly, as far as I can tell).

Debian also supports pump, but I'm not sure if it sets the default route correctly like dhclient seems to.

Thanks for your quick reply,

Adam Goode

Package name confusion, and a fix

Re: Feedback: dhclient for Linux (Adam Goode)
Date: 2000, Feb 24
From: David Hinds <dhinds@pcmcia.sourceforge.org>

Oh, Debian calls it dhcp-client, which threw me off.  It appears to me
that the right fix is just to change that route command to:

  route add default dev $DEVICE netmask 0.0.0.0

which should work for any DHCP client that needs it, and should be
harmless for any client that does it on its own.

-- Dave

More: Hmmm, almost, but not quite

Re: Package name confusion, and a fix (David Hinds)
Date: 2000, Feb 24
From: Adam Goode <goodea@rpi.edu>

Yes, but this still switches the default route from the first ethernet card inserted to the second. Basically, whichever card is added last becomes default route.

My main trouble is that the second ethernet card is a wireless card, so that if I am not near an access point, dhcp fails and shouldn't change any route. This preserves my wired ethernet card as default. In general, though, I think I want to be able to select an interface to be preferred default route (because the default should be the wired card if that's active).

Is there a better solution to this (perhaps) more general problem of picking an interface to be default route?

Let me know if I've confused anyone terribly. (Besides myself.)

Adam Goode

Argh

Re: More: Hmmm, almost, but not quite (Adam Goode)
Date: 2000, Feb 24
From: David Hinds <dhinds@pcmcia.sourceforge.org>

Then I guess it actually didn't help at all, right?  Well, I think
I'm also quite confused.

> Is there a better solution to this (perhaps) more general problem of
> picking an interface to be default route?

My suggestion would be for you to just define two PCMCIA schemes, one
for when you're wired, and one for when you're wireless.  Use cardctl
to pick your scheme.  I guess it isn't quite as nice as automatic
fall-over from one card to the other, but I'm not sure there is a good
general solution to that problem.

-- Dave
route add unnecessary for dhclient?


[ Add Message ]  to: "route add unnecessary for dhclient?"

[ Members ]  [ Subscribe ]  [ Admin Mode ] 
[ Show Frames ]  [ Help for HyperNews at pcmcia-cs.sourceforge.net 1.10 ]