AirPort

In my home I have an AirPort Express (let’s call it AE, from now on) with AirTunes, and I like to be able to switch between wireless and wired networks without having to reconnect all my network shares and other tcp/ip connections. This had me wondering if this would be possible with the Airport Express and I found a way to make it happen. Let me explain the network setup.

Network Setup

In my home there is a DHCP-server which hands out IP-addresses in the range x.x.x.200 up to x.x.x.250. There is also an AE which has IP-address x.x.x.99 (on the ethernet side). It used to hand out IP-addresses in another range and provide access to the internal network via NAT (default config). I changed this, so now the AirPort Express hands out IP-addresses in the range x.x.x.100 up to x.x.x.199 (ok, maybe a bit overdone, especially considering ethernet has less addresses). Surprisingly, this worked like a charm (I had expected problems with routing in the AE), so it’s possible to have the same subnet on both sides of the AE. Next step was to give my MacBook the same IP-address on the wired as well as on the wireless interface. Since the IP-address was already fixed (via DHCP; lets say x.x.x.64) on the wired side, I only needed to fix it in the AE. Unfortunately, I couldn’t find an option to fix IP-addresses based on MAC-addresses. What I wanted to avoid was static IP-addresses set up in my MB, because then I would have trouble with other wireless netwerks not at home. Fortunately, OS X can configure ‘Locations’, with each its own (network) configurations. So I configured a ‘home’ Location with a static IP-address on my wireless interface and DHCP on my wired interface (both which receive the same IP-address).

Results

Well, how does it work? Perfectly! When I plug in my ethernet while I’m ssh-ed to a remote machine via the wireless interface, I don’t notice any glitches except AirFoil, which is confused for a couple of seconds, but automatically reconnects without hanging iTunes (at least not for long). The mounted CIFS shares also have no problem at all (I have a Linux server which shares music via Samba). I can switch off wireless and everything keeps working, resuming my typing in the ssh-session (I’m typing this story in said ssh-session), although AirFoil reconnects again. When I switch on wireless, AirFoil is confused again for a couple of seconds but reconnects automatically. After that I can pull out the ethernet cable and again continue my typing (and AirFoil reconnects again). I’m happy :)