Incorrect Wireless Channel
I appear to have found a bug in the wireless configuration in pfSense. This problem did not appear until I added a second wireless interface to my configuration to allow for a second SSID. I believe it is somehow related. Both wireless networks are in Access Point (hostap) mode. As such, I am specifically defining the channel. Since they are both running on the same wireless adapter in the same band (2.4GHz), I am using the same channel for both interfaces. The reported problem is that a device will attempt to associate to one of the SSIDs. They appear to associate but will not receive an IP address from DHCP. They will also not appear in the wireless client list in pfSense. In researching the problem, I have found that one of the interfaces will be using a random channel rather than the one assigned in the configuration. The output snips below are from a device configured for channel 10.
v ath0_wlan0) bssid 04:f0:21:17:41:af
ssid SSID1 channel 10 (2457 MHz 11g ht/40
ifconfig -v ath0_wlan1
ssid SSID2 channel 6 (2437 MHz 11g ht/40+) bssid 06:f0:21:17:41:af
I have modified the XML configuration to test various configurations. I tried a) setting the channel on each interface, b) setting the channel only under the global wireless configuration and not on the interfaces, and c) setting the channel on the interfaces and in the global setting. None of these have resolved the issue.
I am only able to reproduce the problem on certain devices, even though the hardware is identical. The problem also only appears when the configuration is applied on restore or reboot. If you go to the problem interface and hit Save, without making any changes, the ifconfig output will then show the channel as correct and clients will be able to use the network.
One final point, the problem may be related specifically to wlan1 (ex: ath0_wlan1). My initial configurations used two interfaces build from the Wireless list in the interfaces configuration. This resulted in two interfaces: ath0_wlan1 and ath0_wlan2 with the problem interface being ath0_wlan. I recreated the configuration using the real interface (ath0) for one interface and a wireless interface for the second. This created interfaces ath0_wlan0 and ath0_wlan1 with ath0_wlan1. Notice that in both cases that wlan1 was the faulty interface even though it was the first interface in config #1 and the second interface in config #2.
If you need any further information, please let me know.
#1 Updated by Jim Lohiser about 5 years ago
Looks like the wiki parser got the better of me. The ifconfig info show correctly below.
ifconfig -v ath0_wlan0 ssid SSID1 channel 10 (2457 MHz 11g ht/40) bssid 04:f0:21:17:41:af ifconfig -v ath0_wlan1 ssid SSID2 channel 6 (2437 MHz 11g ht/40+) bssid 06:f0:21:17:41:af
#2 Updated by Jim Lohiser about 5 years ago
Please ignore my comments regarding wlan1 specifically being an issue. After restoring the configuration on the same device, ath0_wlan0 now has the random channel.
ifconfig -v ath0_wlan0 ssid SSID1 channel 6 (2437 MHz 11g ht/40+) bssid 04:f0:21:17:41:af ifconfig -v ath0_wlan1 ssid SSID2 channel 10 (2457 MHz 11g ht/40-) bssid 06:f0:21:17:41:af
#5 Updated by Jim Lohiser almost 5 years ago
I am still having this problem on a number of pfSense devices.
ssid SSID1 channel 10 (2457 MHz 11g ht/40-) bssid 04:f0:21:14:c7:54
ssid SSID2 channel 1 (2412 MHz 11g ht/40+) bssid 06:f0:21:14:c7:54
The problem only seems to occur after pfSense is restarted. One of the SSIDs will be on a random channel. The other will be on the correct channel as per the configuration. If I log into the web interface, go to one of the wireless interfaces, select Save and then Apply (without making any changes), the problem is resolved (i.e. both SSIDs are then on the same channel). The problem is resolved until the next reboot when it may or may not occur. It seems as though something is not being sent properly on bootup or is possibly timing out. Perhaps the channel assignments need to be moved to later (near the end) of the boot process. I am on 2.2.6.
The problem cropped up after I setup multiple SSIDs. It would seem that is somehow related.
Jim, you made the comment about multiple 802.11 radios. Could you please clarify your comment as related to this issue? Are indicating that you believe this radio is not appropriate for use with pfSense because it has 2.4Ghz and 5Ghz radios? Do you believe that this random channel issue would not exist if there was only one radio in the card?
#6 Updated by Anonymous over 4 years ago
I ran into the same issue when using an ath interface and virtual interfaces in hostap mode (VAPs). I have a similar setup as yours. It seem that the 1st VAP interface is brought up successfully with the right parameters. What happens is that the 2nd interface is brought up and that results in the 1st interface losing its configured parameters and getting random parameters instead. I suspect this is a bug in the ath driver.
What I ended up doing to work around this issue is to split off the part that configures the interface from the part that brings up the interface, splitting a single operation (ifconfig athX_wlanY up <parameters>) into two consecutive operations (ifconfig athX_wlanY <parameters>; ifconfig athX_wlanY up). This seems to have fixed the issue for me. I've created pull request https://github.com/pfsense/pfsense/pull/3180 and hope to have it included into one of the following releases.I have found several other issues related to using virtual interfaces and have created 2 other pull requests:
Using these 2 PRs in addition to the PR that I mentioned earlier provides a predictable and usable setup when using Virtual APs. You can apply the patches on a live box with the "System_Patches" package.