Setting up Wi-Fi on FreeBSD 11.1

I have tried to set up wireless networking on my FreeBSD 11.1 install, but it isn't working. I have identified the wireless adapter (ral0) using "sysctl net.wireless.devices", I have added a section to /etc/wpa_supplicant.conf and added lines to /etc/rc.conf. When I run "ifconfig", it now lists wlan0 but the status is set to "no carrier" and "ifconfig wlan0 list scan" produces nothing. Does this mean the driver isn't working for this wi-fi card?
 
chances are high it's /etc/wpa_supplicant.conf related: you should report which kind of connection are you trying to attach to (indicated by the output of ifconfig wlan0 scan) and the wpa_supplicant.conf you're using.

and "ifconfig wlan0 list scan" produces nothing.

you did bring your interface up first, didn't you? ifconfig $interface up is the equivalent of Linux iproute2's: ip link set $interface up

In case this didn't work, and you're used to wpa_supplicant from Linux or other BSDs, where the device used to correctly connecting to the network of interest with that same configuration, then probably it is something driver-related or due to a /boot/loader.conf issue, or even routing/netif services. Sometimes restarting routing and netif 2-3 times in that order does the trick (if signal is loose, it's not uncommon, at least in my experience, to see "status no carrier" at the first 1-2 attempts, and "status associated" at the following try)
 
chances are high it's /etc/wpa_supplicant.conf related: you should report which kind of connection are you trying to attach to (indicated by the output of ifconfig wlan0 list scan) and the wpa_supplicant.conf you're using.



you did bring your interface up first, didn't you? ifconfig $interface up is the equivalent of Linux iproute2's: ip link set $interface up

In case this didn't work, and you're used to wpa_supplicant from Linux or other BSDs, where the device used to correctly connecting to the network of interest with that same configuration, then probably it is something driver-related or due to a /boot/loader.conf issue, or even routing/netif services. Sometimes restarting routing and netif 2-3 times in that order does the trick (if signal is loose, it's not uncommon, at least in my experience, to see "status no carrier" at the first 1-2 attempts, and "status associated" at the following try)

Thanks for all that. I'm not particularly au fait with either Linux or FreeBSD and had not needed to do anything low-level to get it working in various Linux distros previously, so I had been using google to try to get the wi-fi connection working. I hadn't brought the interface up ( ifconfig wlan0 up produced no output), but after doing so ifconfig wlan0 list scan still produces no output at all. I have tried restarting netif a couple of times (but not routing). It's a WPA router I'm trying to connect to and the signal should be pretty good as it's only a few feet away and with no other devices connected to it.

EDIT: Also, ssid is "" from ifconfig
 
Short way for setting "Intel Corporation Centrino Wireless-N 1000", for example.
Add
Code:
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA DHCP"
to /etc/rc.conf and
Code:
network={
ssid="networkname"
psk="password"
}
to /etc/wpa_supplicant.conf

Then run # service netif restart

Just found out that I almost quoting handbook :D.

Also it is possible to use net-mgmt/networkmgr:
Maybe someone doesn't know,
there is a nice app in ports tree (originated from GhostBSD) that manages ethernet and wi-fi connections pretty well.
net-mgmt/networkmgr
0Ehs9kp.png


To use it:
1. install it # pkg ins networkmgr
2. create /usr/local/etc/doas.conf with following content:
Code:
permit nopass keepenv :wheel cmd netcardmgr
permit nopass keepenv :wheel cmd detect-nics
permit nopass keepenv :wheel cmd detect-wifi
permit nopass keepenv :wheel cmd ifconfig
permit nopass keepenv :wheel cmd service
permit nopass keepenv :wheel cmd wpa_supplicant
3. your user shoud be in a wheel group.
(Execute # pw groupmod wheel -m yourusername and then relogin.)
 
Yes, I had set up wpa_supplicant.conf and rc.conf correctly as above and restarted netif service, but ifconfig elan0 up scan just shows no wireless networks, and there are at least a dozen in range that my other computers can see. FreeBSD seems to be set up to use the wi-fi adapter, but then the adapter doesn't seem to do anything so that's why I'm wondering if it's the driver. Is there some way I can check?

I've also installed the networkmgr package - can I use it from the command line at all?
 
Your 'wlan0' is up and responding to ifconfig. So routing need to be restarted. Network manager creates its icon some where in system tray.
 
Your 'wlan0' is up and responding to ifconfig. So routing need to be restarted. Network manager creates its icon some where in system tray.
I'm not using the GUI, just the command line. When I run service routing restart it deletes everything and then adds everything instantly, but then ifconfig still reports "no carrier" for wlan0. "no carrier" suggests to me that the wi-fi card is not properly activated, hence why I am questioning the driver.
 
Yes, I have net.wlan.devices: ral0 and
Code:
wlans_ral0="wlan0"
. I didn't have
Code:
if_ral_load="YES"
in /boot/loader.conf, but adding it doesn't seem to have made much difference. Does anyone know if there's some sort of wi-fi debugging tool for FreeBSD?
 
Hello 3guesses
AFAIK there is wlandebug(8).
Thanks pensador. I have run wlandebug +scan but am having a little trouble interpreting the output (how can I capture it, BTW?). It seems to scan all of the 802.11g channels but doesn't show anything interesting to my novice eyes. What should I be looking for?

EDIT: I found a post on Google groups which would seem to suggest I should be seeing "wlan0: received beacon from <MAC address> rssi XX" in the channel scans, but I'm not seeing any such lines. To me it seems more and more likely that it's a problem with the driver not working properly for the wifi card...
 
First add if_ral_load="YES" in /boot/loader.conf, then add in /etc/rc.conf:
Code:
wlans_ral0="wlan0"
ifconfig_wlan0="DHCP"
defaultrouter="192.168.0.1" (it's just an e.g., see your router gateway)
create_args_wlan0="country US regdomain NONE"

After that create/edit /etc/wpa_supplicant.conf and add:

Code:
network={
    ssid="yourssid"
    bssid=8e:79:35:0d:e8:8c (it's just and e.g. add your bssid)
    key_mgmt=WPA-PSK
    proto=RSN
    psk="YourPassWord"
}

Finally restart the interface: service netif start
 
gnath: Yes, I have gone through man ral but it doesn't provide much in the way of troubleshooting.

Minbari: Yes, I have made all of the configuration changes to the system but the system is not picking up any APs when scanning, so most are irrelevant at this point any way.

trev: What errors should I be looking for? grep "ral0" /var/log/messages just shows 2 lines, one showing the PCI IRQ and the other showing the MAC for the card

It seems to me that the scanning process is not working correctly, which suggests to me that the driver is not fully compatible with the wifi card but I don't know how to confirm this.
 
That's my guess as well (that the driver may not be compatible). By the way, have you set up any firewalls? Also, if, by chance, all the networks were hiddent networks (unlikely these days, but in the old days Linksys, at least, had it that way by default), you would need the line
Code:
scan_ssid=1
in your /etc/wpa_supplicant.conf file.

Aside from that, I'm not sure why it's not working. One workaround might be the Edimax 7811UN USB to wireless adapter, which, at least in the US is less than $10 dollars on Amazon.
https://www.amazon.com/Edimax-EW-7811Un-150Mbps-Raspberry-Supports/dp/B003MTTJOY
 
One thing I often do is run /security/wpa_supplicant manually. Something like:

/usr/sbin/wpa_supplicant -dd -Dbsd -i wlan0 -c /usr/local/etc/wpa_supplicant.conf

The lack of -B keeps your terminal and the -dd gives you verbose debug output.
 
Back
Top