Spoof MAC of hostap



  • I set a spoofed MAC for ath0 in the interface setup dialog.
    I have created a hostap on that interface (ath0_wlan0).
    ifconfig shows that ath0's MAC is it's hardware MAC.
    ifconfig shows that ath0_wlan0's MAC is the spoofed address.

    ath0's MAC is seen by hostap clients because the BSSID is taken from ath0. :(

    That sort of doesn't work as intended, or does it? I'd like clients to see the spoofed MAC. Can you help me?
    http://redmine.pfsense.org/issues/841 might be relevant.
    Thanks



  • This kind of needs it own setting, because you can only set the MAC of the base device to affect the BSSIDs of the virtual wireless interfaces that are generated.  The driver will not host a wireless network with a BSSID that differs from the MAC of the base device other than certain bits it changes when you create more than one virtual device that runs on the same base device.

    There is no way to configure this through the GUI at the moment, since pfSense does not actually configure the ath0 device, instead creating ath0_wlan# devices to be configured.  FreeBSD 8 or higher, used by pfSense 2.0 or higher, actually stopped using the base device name directly, other than for querying some device details and creating virtual wireless interface that are what you actually configure with all the network settings.  pfSense 2.0.x and 2.1 internally convert the ath0 name to ath0_wlan0 instead, so that is why the MAC address setting does not affect the ath0 device.

    Just for reference to those who might want to work on this, adding a setting to change it is not as simple as just changing the MAC on the base wireless device.  As far as I know, any existing virtual devices for access points created before the MAC was changed need to be removed and recreated to generate a new BSSID based on the new MAC on the base device, since IIRC the BSSID cannot be changed once an access point virtual device is created.  On boot, this setting would need to be applied before any of the virtual wireless interfaces get created.  This is because the driver won't allow the BSSID to differ from the MAC you've configured for the base device (beyond certain bit fields it changes when you have multiple access points).


Log in to reply