Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

Easily move between wired and wireless networks Network
I thought I'd post my experiences here since I haven't found anything on this topic.

I run a small LAN with networked home directories, Library and Apps (using a FreeBSD NFS server), and I wanted to be able to seamlessly move my laptop between wired and wireless interfaces without disrupting my connections (ssh sessions, and especially my NFS home directory).

I just got an AirPort Express and it was a lot easier than I expected. All I did was set my base station in LAN-bridging mode (by unselecting "Distribute IP addresses) and configured my own DHCP server to give the same IP address to my laptop's wireless interface as its wired interface. Mac OS X allows both interfaces to have the same IP address (it complains a bit in system.log).

Everything just works from that point. On my server, I get a log message from arp saying that my IP address moved from one MAC address to another, but it happens almost instantly; I don't have to flush the arp cache at all.

The only hitch I've run into so far is that I need to be plugged into my LAN in order to wake my laptop from sleep: when my laptop wakes from sleep and isn't plugged into the wired LAN, it doesn't automatically associate with my AirPort network and when I click on the AirPort menu item to associate it, it evidently tries to read something from my home directory, which isn't available and I get the spinning cursor. If I then plug into the LAN, everything is fine.

Anyways, it's working far better than I had ever hoped!
    •    
  • Currently 1.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (1 vote cast)
 
[13,125 views]  

Easily move between wired and wireless networks | 22 comments | Create New Account
Click here to return to the 'Easily move between wired and wireless networks' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Easily move between wired and wireless networks
Authored by: crispyking on Aug 26, '04 12:46:14PM

To follow-up, the problem waking from sleep when disconnected from the LAN only occurs when I'm using an account that uses network home directories. If I fast-user-switch to another local account before putting the laptop to sleep, it wakes up and re-associates to the base station just fine.

Since the AirPort configuration is stored locally in /Library/Preferences and doesn't appear to have any per-user configuration, it might be that the AirPort connect software is getting stuck on something trivial like searching the Preferences search path: ~/Library/Preferences, /Library/Preferences.



[ Reply to This | # ]
Maybe this hint will help
Authored by: jecwobble on Aug 26, '04 01:44:55PM
If you use this hint, you can FUS to the login screen or possibly the other local user.

[ Reply to This | # ]
What actually makes this work?
Authored by: diroussel on Aug 26, '04 04:29:59PM

Any one got any ideas how to do with with other routers? I've got a Linksys WRT54G, and I'm I would like to replicate this neat trick.

As far I was aware DHCP allocates IP address per MAC address on a lease basis, and since the AipPort and Eth adaptor have a different MAC they get given different IP addresses? What is it in this hint that allows it to work?

Surely when you disconnect the LAN cable there is no time to release the lease on IP, so how is that IP still free to be reallocated to the AirPort.

I have a linux server I could use as a DHCP server, and I believe my router has bridging capabilies (although I've not tried them). Any one got any ideas for me to try?

Thanks, Dave

[ Reply to This | # ]

What actually makes this work?
Authored by: Brock Lee on Aug 26, '04 06:20:59PM

The key to the initial post is this phrase "configured my own DHCP server". Most DHCP servers (e.g., that you'd run on a server running Linux or BSD and not on a wireless router) allow for the setting of mappings from specific MAC addresses to specific IP addresses. The WRT54G does not offer this capability.

I understand there is some 3rd party firmware out there that adds extra capabilities to the WRT54G. Whether this level of control is one of the capabilities, I do not know.



[ Reply to This | # ]
What actually makes this work?
Authored by: pecosbill on Aug 26, '04 07:02:27PM

Since it's YOUR LAN, why not just set up a network location for your LAN and assign a static IP address to each interface that's the same (not using DCHP at all)? Sounds like it would do the same thing but without the DHCP challenge.

---
Pecos Bill



[ Reply to This | # ]
What actually makes this work?
Authored by: crispyking on Aug 26, '04 07:20:22PM

Right, I'm running my own DHCP server on my LAN, but if you're not running a DHCP server, you should be able to set the IP address manually in the Network System Preferences.

There are two tricks that make this work. The first isn't much of a trick: you just configure the wireless AP to be a simple LAN bridge. It simply bridges ethernet traffic between the LAN and the wireless network, so it basically operates transparently like a hub or switch. I would think you could do this with any wireless AP.

The second trick is to configure the wireless interface to have the same IP address as the wired one. This is the real trick since you're really not supposed to configure more than one interface on a given subnet. It's a bit of a hack since all the other machines on the LAN see the MAC address changing for that IP address and complain in the log file in case it's a spoofing attempt. But they change their ARP caches anyways and everything continues to work. It's the fact that Mac OS X allows you to set the same IP address for multiple interfaces that makes this work.



[ Reply to This | # ]
It's not as complicated as you think...
Authored by: jtrott on Aug 27, '04 04:17:27AM

I don't think you actually need to do any configuration on the DHCP server at all. I've been using the same setup (moving from lan to wireless without dropping connections) for a while now. The secret is to set your DHCP Client ID to the same on both interfaces. As an aside, if you set it to the same as in your Sharing control panel and make it a single word with just letters and numbers (no spaces), the DHCP server will record your client name and correctly configure dyndns (if you have it setup).
In short, make your DHCP Client ID the same on both interfaces and make the Sharing Computer Name the same again to make sure that the DHCP client name is recorded correctly on the DHCP server. There is no need to mess with the DHCP server configuration.
HTH,
JT



[ Reply to This | # ]
It's not as complicated as you think...
Authored by: crispyking on Aug 27, '04 12:08:21PM

It depends on the situation. I tend to prefer making changes on my DHCP server so I don't have to mess around with each client machine's settings :-)



[ Reply to This | # ]
It's not as complicated as you think...
Authored by: jtrott on Aug 30, '04 07:40:24AM

Well, I prefer to change my iBook setup, rather than all the DHCP servers I come in contact with in a normal work day :)
To each their own I guess ;)
JT



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: T u r b o on Aug 26, '04 07:13:42PM

This doesn't really seem 'easy' to me. My simple solution since the 10.1 days is to have both interfaces setup with a static IP. Just make it the same for both the Ethernet port and the Airport interfaces.

I've been doing it this way for years, and I've never had a problem accessing NFS shares and such upon wakeup; it connects to my WRT54G immediately upon opening.

- Mike



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: crispyking on Aug 26, '04 07:29:06PM

You're right; now that I think about it, just setting the IP address manually is an easier way of describing it.

In my case, since I was already using a DHCP server for my LAN, it was easier for me to just add an entry there. :-)

FYI, if you're doing it with DHCP, the static entry for the wireless interface needs a different host name or dhcpd complains. Fortunately, the MacOSX set-hostname script (in /System/Library/SystemConfiguration/Kicker.bundle/Contents/Resources) ignores that and sets the hostname based on a reverse DNS lookup.



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: n9yty on Aug 26, '04 11:02:46PM

I'm sure the complaints in the system log are irrelevant... They couldn't possibly be there for a good reason, could they?

Both interfaces are active at the same time, and in general, it's a very-bad-idea to set it up that way, which is why the complaints are there.



[ Reply to This | # ]
Use a DHCP client identifier
Authored by: iljitsch on Aug 27, '04 03:43:46AM

I've been doing this for a while, and I always inteded to write up a hint after some more testing.

Anyway, what I do to get the same IP address on both interfaces, is give them both the same client identifier. AFAIK, most DHCP servers will look at the client identifier rather than the MAC address so this should give you the same address for both interfaces. However, I've only tried this with a Cisco router as a DHCP server, so I can't be sure that more generic stuff works the same way.



[ Reply to This | # ]
Use a DHCP client identifier
Authored by: jtrott on Aug 27, '04 04:22:48AM

Actually, what seems to happen is that MacOS X doesn't use the MAC address as a DHCP identifier. It generates another unique string from the DHCP Client ID and other information. The side effect of this is that if all interfaces have the same DHCP Client ID entered then all interfaces get the same IP address if they are talking to the same DHCP server. You can see this if you look at the DHCP server leases, for windows boxes they will show the MAC address. For MacOS X boxes it will show a much longer string.
HTH,
JT



[ Reply to This | # ]
Use a DHCP client identifier
Authored by: snarke on Oct 07, '04 07:57:31AM

My, that's very cool. I've had two IP addresses for my laptop, because I couldn't figure out how to give both the Ethernet and Airport the same one. It hasn't really been a big deal, since the connection would switch back and forth even though the IP was different, even for a chat client (amazing!), but it did make my DNS entries annoying.

At first, setting the Client ID didn't seem to work. As it turns out, that's because my D-Link router would assign a dynamic IP based on the full Client ID (the word changed to hex), but when I tried to associate it with a fixed, reserved IP, it would only remember the first six characters. Changing the ID to a six character word means it now assigns the same IP address to either interface, despite the different MAC addresses. Nifty!



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: denty on Aug 27, '04 04:00:04AM

This is surely an unusual situation for a home computer to find itself in - IP addresses migrating from one MAC address to another! But it's not so unusual in server land.

It may confuse some clients for a while but your Mac - with its solid UNIX core - should be fine.

Sometimes, this is used as a means of providing resilience against physical failure of a cable or interface as the OS and other computers will simply ask for the new MAC address and start using it.



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: HooshNu on Aug 27, '04 10:43:00AM

How well does this work when you plug back in? I've got network home directories at home as well, and have managed a few times to successfully switch on the fly from ethernet to AirPort (with different static IP's set on each interface, since my wired and wireless networks are currently on different subnets), but plugging the cable back in never switches it back to ethernet. The connection is live, but file transfers happen over AirPort instead of ethernet, even with the interfaces set in the proper order in System Prefs. Have you done a file transfer to test the speed to see if it switches back?



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: crispyking on Aug 27, '04 12:30:39PM

If your interfaces are on different subnets, then any connections you make on one interface will stay on that interface for the duration of that connection. I would expect that when you plug back to the LAN, any new connections you make would go through your LAN port. You need to have the same IP address on both interfaces for existing connections to move between interfaces.

When I plug back to the LAN, all my connections revert back to the LAN interface. I verified this by checking the ARP table on my server ('arp -a'). The ARP entry for my laptop changes back to my wired interface's MAC address and there is no ARP entry for my wireless interface.



[ Reply to This | # ]
Easily move between wired and wireless networks
Authored by: HooshNu on Aug 29, '04 10:50:58PM

THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!! THANK YOU!!

I set this up over the weekend and it works FLAWLESSLY!!! I can't believe how cool this is. In fact, as a test I was downloading the 10.3.5 update. With the LAN plugged in I was getting 1.1MB/sec, I unplugged the LAN and the speed dropped to 300Kb/sec, then I plugged it back in and right back to 1.1MB again, and the download never even paused! This one belongs in version 2 of the book. [Comic Book Guy]Best...hint...EVER![/Comic Book Guy]



[ Reply to This | # ]
How do I modify the DHCP server?
Authored by: gjm25 on Sep 07, '04 09:45:58AM

I am running 10.3.5 server with Apple's DHCP and DNS servers. Would love to do this at the server side using DHCP as the hint suggests, but do not know how to assign IPs based on MAC address. The UI does not allow it as far as I can see, and I don't know where to start looking for configuring DHCP from the command line. Any pointers/links?



[ Reply to This | # ]
How do I modify the DHCP server?
Authored by: crispyking on Nov 26, '04 12:00:55AM

You can define static bindings in OSXS's DHCP by defining hosts in Workgroup Manager and assigning them MAC addresses. Apple's DHCP automatically serves those machines with static IP addresses.



[ Reply to This | # ]
enter them in the netinfo-database:
Authored by: nick on Nov 12, '05 03:03:08PM

in the domain "machines" make an entry per machine with the following properties:

- name (the name of the box; can be anything)
- ip_address (guess what: the reserved ip)
- en_address (the mac-address)

thats it. the buildin dhcp-server will now give the reserved ip to the designated box.



[ Reply to This | # ]