Re: wireless + wired + dhcp +... : unproper default route
From: Jerome BENOIT (jgmbenoit_at_wanadoo.fr)
Date: 12/30/03
- Previous message: Paul Morgan: "Re: David Grudek/COR/AXE is out of the office."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 30 Dec 2003 15:29:57 +0200 To: Matt Foster <mattfoster@clara.co.uk>
Thanks for your reply.
Matt Foster wrote:
> Quoting Jerome BENOIT (jgmbenoit@wanadoo.fr):
>
>>Thanks for your reply: fellowing the below advice
>>I wrote an adquate script that I put in the directory
>>/etc/network/if-post-down.d
>>to set a default route when it is missing:
>>
>>route add default gw <default ip>
>>
>>According to the man page we can specify the Iface,
>>instead to let the kernel to chose for us,
>>by adding something as `dev eth0':
>>I have tried it, but each time
>>the default route seems to be blocked after a while
>>(except when I set the kernel favorite Iface).
>>
>>My basic idea was to write after some basic checks:
>>
>>route del default
>>route add default gw <default ip> dev <fastest connected iface>
>>
>>but as I sait I got into troubles:
>>
>>I guess I missed something:
>>any idea ?
>>
>>Thanks in advance,
>>Jerome
>
>
> This may just be me being dense,
I was asking for a hint.
Please note that I am not (yet) familiar with network stuff.
> but why the 'if-post-down.d' directory, as
> opposed to the 'if-up.d' directory? Surely it would be more logical to
> change the routing tables when a new interface comes up?
in my /etc/network/interface I wrote
iface eth0 inet dhcp
iface wlan0 inet dhcp
wireless_<option> <value>
so the routing table is managed by the dhcp manchinerie.
This work fine when only one iface is involved,
but troubles emerge when the two ifaces are involved.
For the post-down why, please see below.
>
> What kind of troubles ddi you have with the route exactly?
>
Up to now I encoutered two cases:
1]
my wireless iface (wlan0) and my wired iface (eth0) are plugged
(my automation scheme used ifplugd): I can do basic stuff.
Now if the iface that hold the default route is unplugged,
then the default route is removed by ifdown (called by ifplugd).
In other words I have no more default route,
hence my post-down action to set up the default route
(when the other card is still present):
route add default gw <default ip>
This just mimics what /etc/dhcp3/dhclient-script does.
And it works.
2]
My second point is that the choice of the default route iface
is done by the kernel since the above command contains no `dev' option.
So as my wired connection is far faster than my wireless connection,
I want the eth0 iface as my default interface when possible:
to do so, I try the fellowing:
route del default
route add default gw <default ip> dev eth0
and to check the routing table:
ping ping.symantec.com
If the default iface was eth0 before the `del' action,
the pinging is ok;
but if the default was `wlan0',
the pinging is ok for a short time,
and then it is lost.
Note that for my wlan0 iface, I have to used the fresh ndiswrapper
driver, so may be the trouble come from there.
Thanks,
Jerome
-- To UNSUBSCRIBE, email to debian-user-request@lists.debian.org with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
- Previous message: Paul Morgan: "Re: David Grudek/COR/AXE is out of the office."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
- Re: route (is it forwarding packets?) (sorry if duplicate).
... >> Is this table forwarding packets from one iface to the other? ... Interesting
I have installed Fedora 2 on my Home PC and FC1 my server at ... I noticed last night at
home that route was returning a route for a ... [root@preload RPMS]# ifconfig
... (Fedora) - Re: No route for localhost
... > But what is driving me crazy is that after I add any route to any other ...
> adding localhost in the routing table, ... be missing. ... (comp.os.linux.misc) - Re: Routing
... to try and route the two other private LANs through the old gateway. ...
Your final routing table will look like: ... iface eth0 inet static ... (Debian-User) - Re: ppp connection Ok but no traffic at all
... > Destination Passerelle Genmask Indic Metric Ref Use Iface ... It looks
like the default route is set to a computer on your local ... Or remove the gateway
entry for your local network from your ... (comp.os.linux.hardware) - Re: Failing to use Linux PC as router
... iface lo inet loopback ... auto eth0 ... iface eth0 inet dhcp
... dhcp access for BOTH computers ??? ... (Debian-User)