Turn off Airport if machine is on Ethernet already

rickdsp
New Contributor

Hi guys,

Not sure if this is doable using Casper. But is there a way to turn off Airport if ethernet is already connected to the network? The reason we want to do this is that we only have a maximum of 100 IP addresses for our wireless and they are filling up. We know that people are wired, but it also grabbing an IP for their wireless as well.

--
Rick Yang
Global Macintosh Standards and Design Engineer
IPG – End User Engineering
(949) 567-9567

4 REPLIES 4

rockpapergoat
Contributor III

there's nothing built-in, so you'd have to make it happen on your own.

even if you disable the airport interface, the dhcp lease will still be valid if the interface negotiates one before it's disabled. in that case, you'd still have issues with your your shrinking dhcp pool.

it may be a better idea to use a different subnet/vlan for wireless or increase the dhcp pool.

tlarkin
Honored Contributor

You can script it, but to be honest I think you are better off just
making all your Wireless come from a different VLAN and DHCP pool. For
example, in every building at my work the x.x.70.x through x.x.78.x is
all wireless VLANs. Everything below that range is for ethernet. I
can only see disabling the airport causing more issues down the road,
especially if they are laptops.

Not applicable

Hi Rick,

Another way of doing it could be to setup Network Locations - 1.) Wired 2.)
Wireless and advise your users to change locations when required...

Not applicable

I run the following script and specify in my policy to only run if the
current network connection is Ethernet. It works well, but I'm not sure
if it will keep your clients from grabbing a DHCP lease prior to wireless
being turned off.

#!/bin/bash

sw_vers|grep '10.5' if [ $? -eq 0 ]; then /usr/sbin/networksetup -setairportpower off echo "AirPort turned off" fi

sw_vers|grep '10.6' if [ $? -eq 0 ]; then /usr/sbin/networksetup -setairportpower AirPort off echo "AirPort turned off" fi