2005/6/29

Mac OS X IP Aliases

Filed under: macosx, apple — plambert @ 11:33 am

Different UNIX and UNIX-like OS’s require different semantics when putting an IP alias on an interface. Mac OS X’s are different from Linux or Solaris.

On Mac OS X, be sure to set your primary IP with the correct subnet mask, but each _alias_ needs to have a subnet mask of /32, or 255.255.255.255.

This is because Mac OS X just lumps all the IPs on a given interface together. As a result, when it comes time to pick an outgoing interface, it uses the first one it sees which can reach the default router. This means it may pick an unexpected one.

For example, on Linux, you might have:

eth0: 10.0.0.2 netmask 255.0.0.0
eth0:1 10.0.0.3 netmask 255.0.0.0

And a default route of 10.0.0.1. When a socket is opened to a remote host, Linux will check eth0, eth1, etc. for a route to the default router, and use that interface for the local address (unless the process specifies it).

However, in the same case, Mac OS X would have:

en0: inet 10.0.0.2 netmask 255.0.0.0
en0: inet 10.0.0.3 netmask 255.0.0.0

Because the kernel might change their order, and there’s no way to _specify_ an order, your outgoing connection might come from 10.0.0.2 or it might come from 10.0.0.3. This won’t change over time, but it might change if you add or remove an alias, or you reboot.

The right way to specify an alias on Mac OS X (and this should work on Linux and other OS’s too, but don’t take my word for it), is to ensure that the default router only lives on one interface:

en0: inet 10.0.0.2 netmask 255.0.0.0
en0: inet 10.0.0.3 netmask 255.255.255.255

Now, only 10.0.0.2’s subnet contains 10.0.0.1, so it’s the only address that will be selected for outgoing connections.

A process can still specify a source address of 10.0.0.3, and it’ll work fine. It’s just the default that’s been made deterministic here.

2004/6/3

Making An Operating System Faster

Filed under: macosx, apple — plambert @ 10:16 am

Making An Operating System Faster

Excellent article on some optimizations in Mac OS X. Not really any new techniques, but still quite fascinating. :-)

–plambert

2004/5/14

APpLe is w8y 1337!!!

Filed under: fluff, apple — plambert @ 12:50 pm

It occurred to me today that when I see some idiot writing in 1337-speek, I should, at least in part, blame Apple.

Thanks, Apple, for the Apple ][ and the Apple //e. You d3w|>s r0×0r.

2004/4/7

emulate a bluetooth headset?

Filed under: apple, bluetooth — plambert @ 6:52 pm

i have a powerbook, thanks to my employer.

i have an ipod.

i also have a nice nokia 3650 bluetooth telephone.

i use them all a great deal. i love them, even.

but there’s something missing…
(more…)

2004/4/1

iTunes smart playlists

Filed under: apple — plambert @ 11:28 am

I just set up a couple useful smart playlists in iTunes. First, I created one which matches “Date Added” “is in the last” “1″ “months” and then “limit to 25 songs selected by most recently added”

I called that “Recently added”

Then I made a similar one (with the same “limit to…” clause) but selecting on “Kind” “Starts with” “Protected”. This I called “Recently bought.”

And actually, they seem to work well…

Proudly powered by wordpress - Theme by neuro