Re: Priority of network interfaces
On Mon, 15 May 2006 17:02:32 +0200
"Alexandre Rossi" <alexandre.rossi@gmail.com> wrote:
> Hi,
>
> > the wireless interface before I get a connection. Is there any IF
> > priority setting available in Debian? What I'd like to do is tell
> > Debian to use the wired interface when both are available.
>
> There are, as far as I know, three ways to do this :
> - dirty hack to automatically ifdown wlan0 before eth0 goes up (using
> pre-up stanzas in /etc/network/interfaces). There may be more
> complicated things using a lockfile for example.
> - using ifmetric to route traffic through the cable instead of the
> wireless NIC.
> - using the bonding kernel driver as suggested[1] once to prioritize
> the cable. I could not make it work with wpa_supplicant and ipw2200
> though, but in my view, it feels like the perfect setup for a laptop.
>
> Sorry I cannot help more... Cheers,
>
> Alexandre
>
> [1] http://www.debian-administration.org/articles/312#comment_9
I have found ifmetric to be very easy to use, and sets up this simply in /etc/network/interfaces:
iface wireless inet dhcp
wireless-essid any
wireless-mode Managed
up ifmetric $IFACE 3
iface wired inet dhcp
up ifmetric $IFACE 1
Its been a while since I did this, but it would appear that passing ifmetric a smaller number results in a higher priority. I must admit, though, that I am not often in a multi-network environment, so I personally have not heavily tested this.
Clayton
Reply to: