Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - alphastar

#1
Decided to create this post based on my (awesome!) experiences with OPNsense 16.x to 18.x so far...and (not so awesome) WiFi support in the latest FreeBSD RELEASE (currently 11.1-RELEASE in OPNsense 18.1.x).


Overview:

Firstly, if you haven't yet, gather info to determine if your hardware is supported by OPNsense.  First stops are the the Hardware and Performance forum board and (of course) the OPNsense User Manual.

You can always confirm your FreeBSD and OPNsense version in Lobby > Dashboard and System > Firmware > Updates, as it will depend on the exact OPNsense 18.x (currently, or later) release you have installed.

Also, OPNsense hardware support also depends on at least two things from FreeBSD: the FreeBSD kernel it's based on and the corresponding Hardware Notes for that FreeBSD RELEASE.  Both can be found at the FreeBSD Release Notes page.  Experienced users may wish to proceed directly to the FreeBSD 11.1-RELEASE Hardware Notes (WLAN Section) related to OPNsense 18.x.


Important! - FreeBSD WiFi Caveats:

Certain WiFi drivers only support "station mode" with certain hardware i.e. as a wireless client (PC)connecting to an existing router/AP - e.g. this Intel Dual Band Wireless AC-3160 on OPNsense 18.x

On a related note, the FreeBSD kernel (up to 11.1-RELEASE) unlike Linux, does not yet have complete support for 802.11ac, so ANY supported WiFi Interfaces will be limited to 802.11n.  Note that depending on your hardware and config, you may only be able to select either the 2.4GHz ("802.11ng") or the 5GHz ("802.11na") bands, but not both simultaneously.

Additionally, (IMHO) the best supported FreeBSD AP hardware running "hostap mode" (i.e. as WiFi routers, Access Points, etc.) use the "ath(4)" driver and Atheros ARxxxx hardware..   However, you will likely have to set "Standard = 802.11na" (5GHz mode) and Channel = "na - 1xx" (5GHz) along with WPA2/AES under Interfaces to obtain optimum speed. 

Some USB adapters under FreeBSD/OPNsense *do* work in "hostap mode", but also tend to be limited to 802.11b/g/a (or any supported combination thereof) - even though the hardware and/or FreeBSD driver may support higher speeds and capabilities.

Taken together, these limitations are why the defacto standard (popular choice?) is to pair an external WiFi router or AP with FreeBSD/OPNsense firewalls.


OPNsense WiFi Quick Config Guide:


  • Start with Interfaces > Wireless > Devices to see what hardware has been recognized successfully by the system.

  • Next, either Add or Assign interfaces under Interfaces > Assignment to map a wireless device to a new or existing Interface created there.
    Interfaces > [INT#] should be configured with any additional settings like Enable Interface, SSID, Minimum Standard and WPA Pre-Shared Key (in addition to the recommendations above) to configure appropriate speeds, channels, etc.

  • You may also need to create a Bridge to the [LAN] interface, configure DHCP, or create/modify the Firewall as additional (optional) steps.  For more info, see the OPNsense User Manual.
  • Lastly, you should be able to see the results in Lobby > Dashboard and Interfaces > Overview.


Troubleshooting:

NOTE: You can also search for your FreeBSD WiFi driver name e.g. ath, ral, run... under System > Log File to give you more diagnostic info on exactly what is happening with the specific driver(s) behind the scenes.

Additionally, here are some additional links and steps I took (including FreeBSD commands in an SSH session) to troubleshoot USB/WiFi issues I encountered while trying to get partially supported AEx000 Linksys USB adapters working with OPNsense.
#2
Quote from: +DS_DV+ on January 12, 2018, 09:21:47 PM

ok so where is a list of supported cards for ap ?


For OPNsense, your best bet is the Hardware and Performance forum board, after checking the OPNsense User Manual.

Further to bartjsmit's reply, note that the list you are looking for is ultimately the FreeBSD kernel.  In the case of the 18.1 series this is the latest FreeBSD 11.1-RELEASE Hardware Notes you already linked to above. 

As for the "iwm(4)" (driver) capabilities under FreeBSD (which supports the Intel Dual Band Wireless AC 3160), while it *is* supported in 11.1-RELEASE and prior, it is only supported in "station mode" i.e. as a wireless client connecting to an existing router/AP. 

On a related note, the FreeBSD kernel (up to 11.1-RELEASE) unlike Linux, does not yet have complete support for 802.11ac, so ANY supported WiFi Interfaces will be limited to 802.11n.  AFAIK, the best supported FreeBSD hardware running "hostap mode" (a.k.a. routers) INTERNALLY, use the "ath(4)" driver and Atheros AR hardware.

USB adapters under FreeBSD do work, but tend to be limited to 802.11b/g/a (or any supported combination thereof) - although the hardware may support higher, as per chemlud's comment.


Taken together, these limitations are why the defacto choice (standard?) is to use an external router or AP for WiFi with FreeBSD firewalls.


#3
Bumping (revisiting) this to provide more info, as I had to review to refresh my memory on what was going on with WiFi on my APU again.  To summarize:

Interfaces > Assignments
OPT1: ath0_wlan1()
OPT2: run0_wlan1()

Interfaces > [OPT1]
Standard: 802.11b, 802.11ng, 802.11g, 802.11a, 802.11na

Interfaces > [OPT2]
Standard: 802.11b, 802.11g, 802.11a

Although the links explain it above, the issue remains that my [OPT2]Linksys AE3000 (USB, 3T3R) should be at least equivalent to the [OPT1]Compex WLE200NX (miniPCIe, 2T2R) - but it isn't because of the FreeBSD driver.  (For those who haven't read above: It's not an OPNSense issue AT ALL)



In terms of next steps IMHO...well...looks like most of us are waiting on this guy:
http://adrianchadd.blogspot.ca/2017/04/bringing-up-80211ac-on-freebsd.html

If I might though, perhaps an OPNsense hardware (detection) GUI page might be useful? 

[EDIT:] It appears that I hadn't paid close enough attention to the GUI before.  On 17.7.10, Lobby > Dashboard > Interface List (bottom right corner) clearly shows which interfaces are WiFi (nice icons!), and the current operating rates (802.11 mode).  Coupled with Interfaces > Overview it should be everything you need to get things figured out.
#4
Update [17.1.7]

Just got around to testing this with 17.1.7 and AE6000.  Plugged the AE6000 via rear USB 3.0 port (APU2C4) and a new run0 device appears in <GUI>Wireless, and although the config is nearly identical to the ath0 device (Compex WLE200NX, working fine), there is no activity light on the AE6000 adapter.

This is with the Linksys AE6000, aka AC580 connected,  from the System: Log File:

May 19 05:05:34 kernel: run0: could not load 8051 microcode
May 19 05:05:34 kernel: run0: timeout waiting for MCU to initialize
May 19 05:05:19 kernel: run0: could not load 8051 microcode
May 19 05:05:19 kernel: run0: timeout waiting for MCU to initialize
May 19 05:05:04 kernel: run0: could not load 8051 microcode
May 19 05:05:04 kernel: run0: timeout waiting for MCU to initialize
May 19 05:04:49 kernel: run0: could not load 8051 microcode
May 19 05:04:49 kernel: run0: timeout waiting for MCU to initialize
May 19 05:04:34 kernel: wlan1: changing name to 'run0_wlan1'
May 19 05:04:34 opnsense: /usr/local/etc/rc.bootup: Cloning new wireless interface run0_wlan1
May 19 05:04:33 kernel: run0: MAC/BBP RT7650 (rev 0x2000), RF RT3053 (MIMO 1T1R), address c8:d7:19:d4:e5:f6
May 19 05:04:33 kernel: run0: <vendor 0x13b1 product 0x003e, class 0/0, rev 2.00/1.00, addr 1> on usbus0



This discussion (24 Mar 2017) suggests that it could be an error with FreeBSD mis-identification of the built-in chip (i.e. inability to match the firmware to the device).  The run0: firmware RT3071 does support the MT7610U chip in the AE6000.

For comparison, here is a successful initialization of the Linksys AE1000, aka WUSB600Nv2, tested in AP mode:

May 19 09:18:05 kernel: run0_wlan1: promiscuous mode enabled
May 19 09:17:57 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 09:17:55 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 09:17:52 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 09:17:49 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 09:17:45 kernel: wlan1: changing name to 'run0_wlan1'
May 19 09:17:44 opnsense: /usr/local/etc/rc.bootup: Cloning new wireless interface run0_wlan1
May 19 09:17:44 kernel: run0: MAC/BBP RT3572 (rev 0x0221), RF RT3052 (MIMO 2T2R), address 00:25:9c:a1:b2:c3
May 19 09:17:44 kernel: run0: <Linksys Linksys AE1000, class 0/0, rev 2.00/1.01, addr 1> on usbus0


and the Linksys AE3000 aka N900 (also successful, AP mode):

May 19 14:21:02 kernel: run0_wlan1: promiscuous mode enabled
May 19 14:20:54 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 14:20:52 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 14:20:49 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 14:20:46 kernel: run0: firmware RT3071 ver. 0.33 loaded
May 19 14:20:42 kernel: wlan1: changing name to 'run0_wlan1'
May 19 14:20:42 opnsense: /usr/local/etc/rc.bootup: Cloning new wireless interface run0_wlan1
May 19 14:20:41 kernel: run0: MAC/BBP RT3593 (rev 0x0402), RF RT3053 (MIMO 3T3R), address c8:d7:19:01:0b:03
May 19 14:20:41 kernel: run0: <Linksys> on usbus0


While the AE1000 and AE3000 work, only 802.11b/g/a is supported (the run(4) FreeBSD driver does not support 802.11n features, see this link.)

Finally, the following messages appear to be common to all adapters (these appear to be random, at least in 17.1.7.  Not sure it causes any problems, but may require further investigation.):

May 19 05:30:25 kernel: run0_wlan1: ieee80211_new_state_locked: pending RUN -> SCAN transition lost
May 19 05:30:25 kernel: ieee80211_new_state_locked: pending RUN -> SCAN transition lost
May 19 05:15:10 opnsense: /interfaces_assign.php: The command `/sbin/ifconfig -m 'run0'' failed to execute ifconfig: interface run0 does not exist
May 19 05:14:42 kernel: run0_wlan1: promiscuous mode enabled
May 19 05:14:41 kernel: run0_wlan1: promiscuous mode disabled
May 19 05:11:14 opnsense: /interfaces_wireless_edit.php: The command `/sbin/ifconfig -m 'run0'' failed to execute ifconfig: interface run0 does not exist
May 19 05:05:41 kernel: run0_wlan1: promiscuous mode enabled


A.
#5
Thanks Franco,

Can't wait to test it out in the next version!

A.
#6
Found the answers to my own question(s):

https://wiki.freebsd.org/WiFi
https://en.wikipedia.org/wiki/Comparison_of_open-source_wireless_drivers#Driver_capabilities_2
https://man.freebsd.org/if_run/4

The Linksys AE1000 is supported out of the box.  For Linksys AE3000 and AE6000 adapter support, see https://github.com/opnsense/tools (edit /usr/src/sys/dev/usb/usbdevs to add the following):

product CISCOLINKSYS AE3000     0x003b  AE3000
product CISCOLINKSYS AE6000     0x003e  AE6000


...then edit /usr/src/sys/dev/usb/wlan/if_run.c:

RUN_DEV(CISCOLINKSYS,             AE3000),
RUN_DEV(CISCOLINKSYS,             AE6000),


and then make kernel)

Note: 802.11 speed is still limited to supported speed for if_run(4) + WiFi in FreeBSD.
#7
Trying to connect to a mixed-mode AP in 802.11n mode (300Mbps) does not seem possible with run0_wlan1 interface (USB Linksys AE1000):

dmesg
run0: <Linksys Linksys AE1000, class 0/0, rev 2.00/1.01, addr 1> on usbus0
run0: MAC/BBP RT3572 (rev 0x0221), RF RT3052 (MIMO 2T2R), address 00:25:9c:f8:41:3e
wlan1: changing name to 'run0_wlan1'
run0: firmware RT3071 ver. 0.33 loaded
run0: firmware RT3071 ver. 0.33 loaded
run0_wlan1: link state changed to UP


ifconfig
run0_wlan1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
        ether 00:25:9c:f8:41:3e
        inet6 fe80::225:9cff:fef8:413e%run0_wlan1 prefixlen 64 scopeid 0x9
        inet 192.168.0.56 netmask 0xffffff00 broadcast 192.168.0.255
        nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
        media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11b
        status: associated
        ssid ISP channel 6 (2437 MHz 11b) bssid 12:34:65:a3:ac:ca:fe
        regdomain FCC country CA authmode WPA2/802.11i privacy ON
        deftxkey UNDEF AES-CCM 2:128-bit AES-CCM 3:128-bit txpower 30 bmiss 7
        scanvalid 60 roaming MANUAL
        groups: wlan

# ifconfig run0_wlan1 list caps
drivercaps=d85c501<STA,IBSS,HOSTAP,SHSLOT,SHPREAMBLE,MONITOR,MBSS,WPA1,WPA2,WME,WDS>
cryptocaps=1b<WEP,TKIP,AES_CCM,TKIPMIC>


Note the line that says media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11b.

Under Interfaces, the Speed and duplex is set to Default (no preference, typically autoselect) (DS and OFDM options for b, g, and n are options) and Standard is set to 802.11a (802.11b and 802.11g are options).

wpa_supplicant
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=0
ap_scan=1
#fast_reauth=1
network={
ssid="ISP"
scan_ssid=1
priority=5
key_mgmt=WPA-PSK
psk="password"
pairwise=CCMP
group=CCMP


Does the if_run(4) USB driver support 802.11n in OPNsense 17.1?