Force wireless WAN to connect to specific BSSID



  • All,

    In my scenario I have a wireless WAN that sees multiple instances of the same SSID. For example, there may be five SSIDs with the name "myaccesspoint." In PfSense, I can tell the wireless card to connect to a specific SSID but what I really need is the ability to define a specific AP to connect to which means I need to define the specific SSID/MAC (BSSID) for the connection.

    Is it possible to define a specific AP to connect to? Also, how would I make this setting persistent across reboots?

    Thank you!



  • There is no option for that at the moment on the page for configuring the wireless interface, but you could change the script to add the parameter.  In /etc/inc/interfaces.inc go to the bottom of the interface_wireless_configure function.  There you should see this:

    	/* configure wireless */
    	$wlcmd_args = implode(" ", $wlcmd);
    	mwexec("/sbin/ifconfig {$if} $wlcmd_args", false);
    

    Before the $wlcmd_args = implode(" ", $wlcmd); line you can add ifconfig parameters to $wlcmd.  If you only have one wireless interface assigned you could change it to this (replace your_ap_mac_here with the AP MAC, with colons as the separator):

    	/* configure wireless */
    	$wlcmd[] = "bssid your_ap_mac_here";
    	$wlcmd_args = implode(" ", $wlcmd);
    	mwexec("/sbin/ifconfig {$if} $wlcmd_args", false);
    

    If you have multiple wireless interfaces, you could do something like this (assuming ath0 is the assigned interface for the example):

    	/* configure wireless */
    	if ($if == "ath0_wlan0")
    		$wlcmd[] = "bssid your_ap_mac_here";
    	$wlcmd_args = implode(" ", $wlcmd);
    	mwexec("/sbin/ifconfig {$if} $wlcmd_args", false);
    

Log in to reply