Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
2 NICs, routing, failover and metric
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Networking & Security
View previous topic :: View next topic  
Author Message
netbui
n00b
n00b


Joined: 03 Jul 2006
Posts: 48

PostPosted: Mon Oct 02, 2006 11:05 am    Post subject: 2 NICs, routing, failover and metric Reply with quote

Hi,

I running Gentoo on a Notebook with both LAN and WLAN. I want to setup the network that it is using as default the LAN connection and, when it is unavailable, automatically make a failover to the WLAN interface. Currently, I have to stop the LAN interface manually with “/etc/init.d/net.eth0 stop” to use the WLAN. If I do not stop eth0, I cannot connect through ma WLAN adapter eth1.
I have read, that the option metric is used for this purpose. My setup is as follows:
Code:
LAN   is 192.168.5.15, Broadcast 192.168.0.255          metric 1
WLAN  is 192.168.0.16, Broadcast 192.168.0.255          metric 2
Default gateway: 192.168.0.1

Is it possible to use metric in this way, or is there a other solution for this problem? Can I use metric for the NICs, even if they are in the same subnet?
Currently I am in the Office and cannot provide you with a rout output.

I wonder if somebody have a hint for me and thank you in advance.
Back to top
View user's profile Send private message
gerdesj
l33t
l33t


Joined: 29 Sep 2005
Posts: 622
Location: Yeovil, Somerset, UK

PostPosted: Mon Oct 02, 2006 6:12 pm    Post subject: Re: 2 NICs, routing, failover and metric Reply with quote

You need a multi-link route which will need a kernel recompile and a good read of http://lartc.org/howto/ alternatively use a routing daemon eg Quagga:

Zebra is the original and Quagga is a fork of the code.

Your /etc/quagga/zebra.conf might look something like:

Code:
!
! Zebra configuration saved from vty
!   2006/02/24 16:25:19
!
hostname <your hostname>
password <your password>
enable password <your password>
log file /var/log/quagga/zebra.log
!
interface eth0
!
interface lo
!
interface wlan0

ip route 0.0.0.0/0 eth0 1
ip route 0.0.0.0/0 wlan0 2



rc-update add zebra default and off you go. It might seem a bit overkill but it gives you a lot of extra flexibility. You don't have to enable forwarding but if you do, then you have a router on your hands.

0.0.0.0/0 is your default route and Quagga will select which one is needed according to the 1 and 2 (metric). You can set both to the same metric and Q will set a multi link route but I've had limited success with this.

Cheers
Jon
Back to top
View user's profile Send private message
netbui
n00b
n00b


Joined: 03 Jul 2006
Posts: 48

PostPosted: Tue Oct 03, 2006 10:28 am    Post subject: Reply with quote

Hi,

thank you very much, I will try it tonight :-)

Cheers
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Networking & Security All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum