Re: interface metrics?
Re: interface metrics?
- Subject: Re: interface metrics?
- From: Howard Shere <email@hidden>
- Date: Fri, 11 Nov 2011 11:08:34 -0500
- Acceptlanguage: en-US
- Thread-topic: interface metrics?
I was hoping the metric would affect the routing, but it sounds like that is not the case.
What I need to do is to find out where a new interface goes in the service order when it is created (i.e., when a new usb network device is inserted). I also need some test code to adjust that order (not for release, but for our test cases).
Does a new interface always go at the top of the service order list? Somewhere else? Are there rules for where it goes which are documented.
-----
As far as the metric itself, the reason I could not see it is that the metric for all of the interfaces is 0 by default. When it is 0 it is not displayed.
So, the results of "ifconfig en0" is:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 10:9a:dd:5b:43:ee
inet6 fe80::129a:ddff:fe5b:43ee%en0 prefixlen 64 scopeid 0x4
inet 10.19.10.197 netmask 0xffffff00 broadcast 10.19.10.255
media: autoselect (100baseTX <full-duplex>)
status: active
But if I do this:
sudo ifconfig en0 metric 50
And then do "ifconfig en0" again, i get this:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> metric 50 mtu 1500
ether 10:9a:dd:5b:43:ee
inet6 fe80::129a:ddff:fe5b:43ee%en0 prefixlen 64 scopeid 0x4
inet 10.19.10.197 netmask 0xffffff00 broadcast 10.19.10.255
media: autoselect (100baseTX <full-duplex>)
status: active
>From what I have read, the higher the metric is, the less desirable the interface is, but it sounds like that isn't being done on the Mac.....so I'll need some other way to adjust the service order, I think I can do this through SystemConfiguration framework
On Nov 11, 2011, at 7:40 AM, Quinn The Eskimo! wrote:
>
> On 7 Nov 2011, at 19:18, Howard Shere wrote:
>
>> I'd like to display the interface metrics for all of the interfaces on my machine.
>
> I'm not sure what you mean by "interface metrics". From reading the rest of your email I get the impression that you think that each interface has some sort of 'score' value that determines how far up the service order list it is. That's not the case. Mac OS X's routing algorithm is quite simple. While there are some edge cases, the gist of it is:
>
> 1. If the packet source or destination address is associated with a specific interface, forward it via that interface.
>
> 2. If not, forward it via the default interface.
>
> The service order, which you can see and set via the UI, determines the default interface. Specifically, the system choses the default interface by looking for the first interface in that list that is 'up'.
>
> S+E
> --
> Quinn "The Eskimo!" <http://www.apple.com/developer/>
> Apple Developer Relations, Developer Technical Support, Core OS/Hardware
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Macnetworkprog mailing list (email@hidden)
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden
Howard Shere
Software Sculptor
901.359.4200
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Macnetworkprog mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden