[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: wireless + wired + dhcp +... : unproper default route



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



Matt Foster wrote:
Quoting Jerome BENOIT (jgmbenoit@wanadoo.fr):

Hello List,

my laptop have both a wired and a wireless connections:
to manage them I plan to use ifplugd beside ifupdown + dhcp stuff.

Of course the connection may be random,
so without proper configuration, the route table may be random,
and certainly unproper: in particular the default route
may disapear if the eth0 is unpluged whereas it was pluged before
the wireless connection. Another configuration is when the wireles connection was pluged first and the wired second, then the default
route is hold by the wireless card which is far slower than the
wired card.

Is there an easy way to avoid these unproper configurations ?
Must we play with dhcp ? or the iptable ?

Thanks in advance,
Jerome



You could use the up (pre-updown post-down) commands in your interfaces
file to play about with the routing table when your interfaces come up
and down.

hth,

matt





Reply to: