Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

m021478

macrumors 6502
Original poster
Nov 23, 2007
378
5
Whenever I am working in my office with my laptop, it is connected to the Internet and to my LAN via ethernet cable. Whenever I'm working on my laptop outside of my office, it is wirelessly connected via Airport. I am trying to figure out a way in which I can automate the process of using the same static IP address on my Macbook regardless of whether I'm connected via ethernet or wirelessly via Airport.

My goal here is to find some way in which I can automatically have my Macbook switch its network configuration settings (ideally triggered whenever plugging-in (and conversely unplugging) an ethernet cable).

Long story short:
  • Plugging in an ethernet cable should result in Airport WiFi connection being disabled, and assigns a static IP address of 10.0.1.xx to my Macbook via it's Ethernet connection.
  • Unplugging the ethernet cable causes the Macbook to switch network profiles so that ethernet connection becomes disabled, and the Airport WiFi network profile then activates (and turns itself on) using the same static IP address of 10.0.1.xx address I'd previously been using with my ethernet...

Anyone have any ideas as to how I might be able to accomplish such a task?

Any support would be greatly appreciated... Thanks!
 

gr8tfly

macrumors 603
Oct 29, 2006
5,333
99
~119W 34N
System Preferences > Network

For both the Airport, and Built-in Ethernet, click on "Advanced..." and go to the TCP/IP tab. For Configure IPv4, select "Manually" and enter the desired IP, mask, and router. (you have to go to Advanced for each device)

Set the device order so Built-in Ethernet is first. The system will look for an active ethernet connection, and if none found, go to AirPort.
 

Nugget

Contributor
Nov 24, 2002
2,122
1,357
Tejas Hill Country
You can also do this without resorting to static IP or futzing with Locations too.

Set the same DHCP Client ID on your laptop for both the Ethernet interface as well as the Airport interface. Then set up a DHCP Reservation in the Airport's configuration for that Client ID. This will cause the Airport to assign the same IP address to both the Airport as well as the Ethernet interface on the laptop, whichever is connected (or both at the same time). Then make sure that the Ethernet is above the Airport on the Network control panel in System Preferences.
 

gr8tfly

macrumors 603
Oct 29, 2006
5,333
99
~119W 34N
gr8tfly has the answer, I just wanted to add that it's a real disappointment that the airport firmware won't allow you to do this automagically via DHCP.

Not sure if this will help, but the Airport can be configured to assign an IP to an individual machine tied to its MAC address. (here's a link to the latest Apple doc on designing Airport networks: Apple Airport Networks
 

Nugget

Contributor
Nov 24, 2002
2,122
1,357
Tejas Hill Country
Not sure if this will help, but the Airport can be configured to assign an IP to an individual machine tied to its MAC address

Yeah, that won't work. In fact, until recent versions of the Airport firmware this wasn't possible at all. The problem is that the Airport will not let you create two reservations for the same IP address.

So you can't create two reservations (one for each MAC address) which assign the same IP.

Now that you can do the reservation by DHCP Client ID, though, it becomes possible since it's the same, single reservation that assigns the IP to both the Airport interface and the Ethernet interface.

As an aside, you can see I edited my first post. I decided that I should probably test to make sure that it was still impossible if I was going to whinge about it online and -- lo and behold -- it works now due to the above change. So I changed my post and I'm happy. :)
 

m021478

macrumors 6502
Original poster
Nov 23, 2007
378
5
System Preferences > Network

For both the Airport, and Built-in Ethernet, click on "Advanced..." and go to the TCP/IP tab. For Configure IPv4, select "Manually" and enter the desired IP, mask, and router. (you have to go to Advanced for each device)

Set the device order so Built-in Ethernet is first. The system will look for an active ethernet connection, and if none found, go to AirPort.

That did the trick!! I could have sworn that this is how I had it setup in the past at one point, but recently for some strange reason attempting to setup both my airport and ethernet with the same static IP would constantly generate a warning message that my IP was already in use...

Maybe it's because I followed your advice and setup the IPv4 settings "Manually" instead of choosing what I would typical use in the past which was "Using DHCP with Manual Address"

Either way, it works now, so thanks to everyone for your help!
 

gr8tfly

macrumors 603
Oct 29, 2006
5,333
99
~119W 34N
Yeah, that won't work. In fact, until recent versions of the Airport firmware this wasn't possible at all. The problem is that the Airport will not let you create two reservations for the same IP address.

So you can't create two reservations (one for each MAC address) which assign the same IP.

Now that you can do the reservation by DHCP Client ID, though, it becomes possible since it's the same, single reservation that assigns the IP to both the Airport interface and the Ethernet interface.

As an aside, you can see I edited my first post. I decided that I should probably test to make sure that it was still impossible if I was going to whinge about it online and -- lo and behold -- it works now due to the above change. So I changed my post and I'm happy. :)

That's good info! Thanks. I wasn't thinking the Airport was being used for both. I was thinking the Mac was setup for static on enet, then the OP wanted to leave the Airport (on the Mac) set for DHCP. Good find! It's fun to learn while teaching. :)
 

m021478

macrumors 6502
Original poster
Nov 23, 2007
378
5
You can also do this without resorting to static IP or futzing with Locations too.

Set the same DHCP Client ID on your laptop for both the Ethernet interface as well as the Airport interface. Then set up a DHCP Reservation in the Airport's configuration for that Client ID. This will cause the Airport to assign the same IP address to both the Airport as well as the Ethernet interface on the laptop, whichever is connected (or both at the same time). Then make sure that the Ethernet is above the Airport on the Network control panel in System Preferences.

I would be extremely grateful if you wouldn't mind providing me with a step by step explanation of how to do this... the alternate method that I'd previously mentioned resolved my problem wound up not being the answer I initially thought it was and I am once again having problems...

Any guidance you'd be willing to offer would be greatly appreciated!!

Thanks!
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.