From: "Alexander E. Patrakov" <patrakov@gmail.com>
To: "Jan Kundrát" <jkt@flaska.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: IPv6: metrics of default routes on different interfaces (Ethernet vs. wifi)
Date: Sun, 28 Aug 2011 21:48:35 +0600 [thread overview]
Message-ID: <4E5A6353.5020202@gmail.com> (raw)
In-Reply-To: <4E5A586E.90509@flaska.net>
28.08.2011 21:02, Jan Kundrát wrote:
> I'm assuming here that the metrics of the default routes are somehow
> derived from the "kind" of the underlying network interface, so that a
> gigabit Ethernet is preferred over a 100Mbps one, which is preferred
> over a 10Mbps one, etc. Please correct me if I'm wrong and the metrics
> have a different origin, or if the wired-ethernet-preference it's just a
> pure luck.
> I've tried grepping my kernel sources, but wasn't able to find out the
> place where the interface type is used in metric assignment.
It is not in the kernel. You have to grep through the source of whatever
utility you are using to configure your interfaces. For dhcpcd, the code
is around line 200 in net.c:
/* We reserve the 100 range for virtual interfaces, if and when
* we can work them out. */
iface->metric = 200 + if_nametoindex(iface->name);
if (getifssid(ifname, iface->ssid) != -1) {
iface->wireless = 1;
iface->metric += 100;
}
but this doesn't match the metrics that you have. So I assume you use
some other tool.
--
Alexander E. Patrakov
next prev parent reply other threads:[~2011-08-28 15:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-28 15:02 IPv6: metrics of default routes on different interfaces (Ethernet vs. wifi) Jan Kundrát
2011-08-28 15:48 ` Alexander E. Patrakov [this message]
2011-08-28 18:49 ` Jan Kundrát
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4E5A6353.5020202@gmail.com \
--to=patrakov@gmail.com \
--cc=jkt@flaska.net \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox