Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    Force wireless WAN to connect to specific BSSID

    Scheduled Pinned Locked Moved Wireless
    2 Posts 2 Posters 4.2k Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • P
      pcexhaust
      last edited by

      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!

      1 Reply Last reply Reply Quote 1
      • E
        Efonnes
        last edited by

        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);
        
        1 Reply Last reply Reply Quote 1
        • D dh377 referenced this topic on
        • First post
          Last post
        Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.