View previous topic :: View next topic |
Author |
Message |
mopoke n00b
Joined: 24 Jul 2005 Posts: 8
|
Posted: Mon Aug 22, 2005 8:27 am Post subject: Setting different metrics for different interfaces |
|
|
Hello,
I may be barking up the wrong tree here so I'll explain my situation first.
I have two network interfaces - eth0 (wired) and eth1 (wireless). I am normally wired but I am happy for the wireless to be on in the meantime (which is what I normally do). Therefore I have net.eth0 and net.eth1 in my default rc profile.
When I boot they both come up but I have no outbound connectivity. Looking at the routing table, this is because there are two default routes (one for each interface) and they have the same metric (0).
Output of route:
Code: |
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
10.0.0.0 * 255.255.0.0 U 0 0 0 eth0
10.0.0.0 * 255.255.0.0 U 0 0 0 eth1
loopback localhost 255.0.0.0 UG 0 0 0 lo
default SpeedTouch.mopo 0.0.0.0 UG 0 0 0 eth1
default SpeedTouch.mopo 0.0.0.0 UG 0 0 0 eth0
|
If I manually delete the routes for eth1 and recreate them with a different metric (e.g. 5) then it all works perfectly.
So my question is: is there a way to say that I want all of the routes created for eth1 to have one metric and all those created with eth0 to have a different?
Or is there a better solution to what I want to do?
Andy |
|
Back to top |
|
|
m_beli n00b
Joined: 11 Jun 2005 Posts: 8
|
Posted: Mon Aug 22, 2005 12:16 pm Post subject: Re: Setting different metrics for different interfaces |
|
|
Well, you cannot have two default routes at the same time (at least in your situation). As I understand, what you're trying to do is to be connected either through eth0 or eth1. Well then, you must tell your kernel which interface you want to use at the moment. It can be done manually, you stop one interface and start the other...
Or it can be done automatically, when you unplug the ethernet cable, the eth0 interface goes down and the route to eth1 is used. It can be done with ifplugd, there is a howto for ifplugd somewhere in the gentoo docs. |
|
Back to top |
|
|
|
|
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
|
|