2

There are several access points with the same SSID name. I would like to either connect to the one I want by MAC address, or block the ones I don't want by MAC address. I found some instructions from an older version of Mac OS X to connect to a certain access point by MAC address. I tried these, but they no longer work on 10.11.6 El Capitan:

In Terminal, type:

/System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport --associate=XXX --bssid=YYY

Where XXX is the SSID/network name and YYY the MAC address of the base station you want to talk to.

Now in El Capitan it seems those flags are removed. The result I get back is:

airport: unrecognized option `--associate=xfinitiwifi'

The airport -help command shows:

Usage: airport <interface> <verb> <options>

<interface>
If an interface is not specified, airport will use the first AirPort interface on the system.

<verb is one of the following:
prefs   If specified with no key value pairs, displays a subset of AirPort preferences for
    the specified interface.

    Preferences may be configured using key=value syntax. Keys and possible values are specified below.
    Boolean settings may be configured using 'YES' and 'NO'.

    DisconnectOnLogout (Boolean)
    JoinMode (String)
        Automatic
        Preferred
        Ranked
        Recent
        Strongest
    JoinModeFallback (String)
        Prompt
        JoinOpen
        KeepLooking
        DoNothing
    RememberRecentNetworks (Boolean)
    RequireAdmin (Boolean)
    RequireAdminIBSS (Boolean)
    RequireAdminNetworkChange (Boolean)
    RequireAdminPowerToggle (Boolean)
    WoWEnabled (Boolean)

logger  Monitor the driver's logging facility.

sniff   If a channel number is specified, airportd will attempt to configure the interface
    to use that channel before it begins sniffing 802.11 frames. Captures files are saved to /tmp.
    Requires super user privileges.

debug   Enable debug logging. A debug log setting may be enabled by prefixing it with a '+', and disabled
    by prefixing it with a '-'.

    AirPort Userland Debug Flags
        DriverDiscovery
        DriverEvent
        Info
        SystemConfiguration
        UserEvent
        PreferredNetworks
        AutoJoin
        IPC
        Scan
        802.1x
        Assoc
        Keychain
        RSNAuth
        WoW
        P2P
        Roam
        BTCoex
        AllUserland - Enable/Disable all userland debug flags

    AirPort Driver Common Flags
        DriverInfo
        DriverError
        DriverWPA
        DriverScan
        AllDriver - Enable/Disable all driver debug flags

    AirPort Driver Vendor Flags
        VendorAssoc
        VendorConnection
        AllVendor - Enable/Disable all vendor debug flags

    AirPort Global Flags
        LogFile - Save all AirPort logs to /var/log/wifi.log

<options> is one of the following:
No options currently defined.

Examples:

Configuring preferences (requires admin privileges)
sudo airport en1 prefs JoinMode=Preferred RememberRecentNetworks=NO RequireAdmin=YES

Sniffing on channel 1:
airport en1 sniff 1


LEGACY COMMANDS:
Supported arguments:
 -c[<arg>] --channel=[<arg>]    Set arbitrary channel on the card
 -z        --disassociate       Disassociate from any network
 -I        --getinfo            Print current wireless status, e.g. signal info, BSSID, port type etc.
 -s[<arg>] --scan=[<arg>]       Perform a wireless broadcast scan.
               Will perform a directed scan if the optional <arg> is provided
 -x        --xml                Print info as XML
 -P        --psk                Create PSK from specified pass phrase and SSID.
               The following additional arguments must be specified with this command:
                              --password=<arg>  Specify a WPA password
                              --ssid=<arg>      Specify SSID when creating a PSK
 -h        --help               Show this help

I see an Assoc preference, but I'm not sure how to use it. Do you know how I can force my Mac to connect or reject specific access points by MAC address? There are multiple access points all with the same WiFi SSID name.

6
  • Have you tried the legacy command ? Does it work or not? (I suspect it is implicit, but please make it explicit :) )
    – Doezer
    Aug 29, 2016 at 9:26
  • Hi @Doezer: Yes, I did try the legacy command. I added a bit more langauge to make that clear in the question.
    – Ben Morrow
    Aug 29, 2016 at 16:05
  • ...so you're using Comcast's provided WiFi and trying to ensure that you're connecting to your own (or specific) router rather than your neighbor's? The command seems to be gone in 10.11... and you can't rename the Comcast-provided WiFi SSID. You may need to invest in a standalone WiFi unit to be sure you know what network you're logging in to.
    – dr.nixon
    Aug 29, 2016 at 18:02
  • Yes, that's right, @dr.nixon. Thanks for your advice
    – Ben Morrow
    Aug 29, 2016 at 23:43
  • I'm the question asker. I just thought of a different angle. Is there a way to block my Mac from connecting to a certain router by MAC address? This would accomplish the same goal. I adjusted the question slightly to offer this route.
    – Ben Morrow
    Aug 30, 2016 at 21:37

0

You must log in to answer this question.

Browse other questions tagged .