# FreeBSD11.1. Establish Wireless.



## Improvisor (Jul 30, 2017)

Greetings to the Intrepid who have just installed FreeBSD11.1. Perhaps one or more of you have already found out how to establish a simple wireless connexion therein; I have not. The new version is different from its forebears.

In order to obviate trouble, I chose the dvd1 iso, FreeBSD-11.0-RELEASE-amd64-disc1.iso, because it is stated to make life easier for those who have not mastered the intricacies of FreeBSD. I burnt it as an iso on a Windows machine and the checksums agree. All that I can say is that this iso is as cryptic as any other iso, but that, wonder of wonders, mounting usb media works perfectly without any configuration on my part, and so does X and Xfce4, as long as one puts dbus_enable="YES" and hald_enable="YES" into /etc/rc.conf. Yea, verily, X does not need hald_enable, so as to enable HAL, but Xfce and some other programmes like it. But the only sure way to ensure pleasant behaviour from X under various applications, including Xfce, is to toss linux_load="YES" into /etc/rc.conf as well. Those three little lines of code save weeks of agony.

Sound and video do not seem to work, either, but I have not addressed those issues yet, being presently preoccupied with

THE WIRELESS.

In the installation procedure from the disc, which seems to be runniing bdinstall, which, if one does not know, one may run again after removing the installation disc, by enterng bdinstall in the command line, my ISP was found, and I selected Ipv4 and DCHP, so as to be able to detect signals in my hectic perambulations as a student, and ultimately use the gui in Xfce, wifimgr, which may be added by simply entering pkg add wifimgr in the command line. I have used wifimgr for five years on older versions with not one piece of trouble.

I did not enable Ipv6 because it always seems to want revenge for some unknown transgression.

Now, it may be useful to add that one ought to connect hard internet through an ethernet (which ought to be spellt aethernet) to the computer before one begins the installation; it makes life easier for those unskilled at configuring the wireless.

After reboot, one normally follows the instructions in the Handbook, https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html, by scrolling down to a section, entitled, 30.3.2. Quick Start, where there is a box with a grey background that normally conatins all that one needs to know in order to establish the wireless connexion.

So, in my innocence, I entered % sysctl net.wlan.devices, and detected my device, ath0. As some may have heard, ifconfig no longer displays the wireless device, which, in my case, happens, as sysctl confirmed, to be ath0.

I then entered % cat /etc/wpa_supplicant.conf, but was told that no such file existed, and so, agreeably to the instructions, I entered % vi /etc/wpa_supplicant.conf (I am used to vi), and created wpa_supplicant.conf, into which I entered

network={
   ssid="_myssid_"
    psk="_mypsk_"
}

For the uninitiated, ssid means the name of the network, something that one will find somewhere that looks similar to NETGEAR111, or LINKSYS111. psk means the password to one's wireless system, such as such a high-security one as iLove?configur123times.nogood/bah\&c

I saved this configuration, and made sure that it was correct by entering % cat /etc/wpa_supplicant.conf. And it was correct.

I then entered % vi /etc/rc.conf, and, agreeably to the instructions, entered

wlans_ath0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"

and saved this configuration, confirming its salvation by entering % vi /etc/rc.conf. And it was correct.

But I noticed something unusual in /etc/rc.conf that I had never seen in versions older than 11.1, namely, a line ifconfig_alc0="WPAD". Entering % ifconfig informed me that this novelty had to do with the hard-wired ethernet. SInce the ethernet was working, I decided to leave well enough alone and get on with it.

I next rebooted the computer, % shutdown -r now, and noticed, in the reboot, that the ethernet, alc0, was active, but the wireless, ath0, was not.

Fiddling with commenting and uncommenting the various appropriate lines in /etc/rc.conf, I find that nothing makes a difference, save that commenting out either or both of the two lines for ath0 produced a noxious TIMEOUT ERROR.

With the ethernet cable removed, % ping www.freebsd.org produces

ping: cannot resolve www.freebsd.org: Host name lookup failure

which, of course, means that the wireless, wlan0, is not working.

After six hours of looking at every possible posting and piece of instruction to be found in perpetual searching of the Web, I came to the conclusion that it would be better to submit this vexatious issue to the learned, rather than to upset the status quo by irreparable amateurish surgery.

Any help would be most gratefully received.


----------



## SirDice (Jul 31, 2017)

The Howto section is not for asking how to do things. Thread moved.

Select the right forum for new threads


----------



## tingo (Jul 31, 2017)

More information is needed. Relevant error messages from /var/log/messages is needed (in this case, relevant means "related to ath or wlan0"). Also, the complete, verbatim messages are needed, not a human interpretation of said messages (we humans are good at many things, but repeating things verbatim is not necessarily one of those). If you can't find any error messages related to ath / wlan0, try a verbose boot.
Also, to identify your wireless chips exactly, relevant output from pciconf is needed. Here is an example:

```
root@kg-z30b# pciconf -lv | grep -B 3 network
em0@pci0:0:25:0:   class=0x020000 card=0x00011179 chip=0x15a38086 rev=0x03 hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Ethernet Connection (3) I218-V'
    class      = network
--
iwm0@pci0:2:0:0:   class=0x028000 card=0x81708086 chip=0x08b38086 rev=0xcb hdr=0x00
    vendor     = 'Intel Corporation'
    device     = 'Wireless 3160'
    class      = network
```
(my wireless is the Wireless 3160 from Intel in this example)
HTH


----------



## scottro (Jul 31, 2017)

I have a quickstart guide some have found useful.  

http://srobb.net/fbsdquickwireless.html


----------



## Phishfry (Aug 1, 2017)

You could also try FreeBSD built in tool:
`bsdconfig wireless`


----------



## Improvisor (Aug 1, 2017)

SirDice said:


> The Howto section is not for asking how to do things. Thread moved.
> 
> Select the right forum for new threads



To my fellow tobacconist (pipe in my case), Sir Dice.

Having read many of your posts over the last five years, your sense of humour is not lost on me. In your link, it is stated that this department is the department of last resort. In my case, it is.


----------



## Improvisor (Aug 1, 2017)

tingo said:


> More information is needed. Relevant error messages from /var/log/messages is needed (in this case, relevant means "related to ath or wlan0"). Also, the complete, verbatim messages are needed, not a human interpretation of said messages (we humans are good at many things, but repeating things verbatim is not necessarily one of those). If you can't find any error messages related to ath / wlan0, try a verbose boot.
> Also, to identify your wireless chips exactly, relevant output from pciconf is needed. Here is an example:
> 
> ```
> ...



Dear Tingo, Many thanks.

The latest is that now the ethernet (which ought to be spelly aethernet) id also down.

`pciconf -;v | grep -B 3 network`

produces these two entries at the end of its recitation:-

```
ath00pci00:0:0:0:    class=0x020000 card=0xe01f105b chip=0x02a168c rev=0x01 hdr=0x00
vendor= 'Qualcomm Atheros'
device = 'AR928X Wireless Network Adapter (PCI-Express)'
class = network

alc00pc00:0:0:0:    class=0x020000 card=0xfc501179 chip=0x20621969 rev=0xc1 hdr=0x00
vendor    = 'Qualcom Atheros'
device    = 'AR8152 v2.0 Fast Ethernet'
class      = network
subclass  = ethernet
```
By the way, using the command again now produces:-

```
savemail: cannot save rejected email anywhere
```
   As Mr. Hardy was once pleased to observe, "Another fine mess".
    So, now, we have no internal email, no ethernet (which ought to be spellt aethernet), and no wireless.
    A propos sendmail, the hostname ought to be correct, according to Sir Dice's instructions in an ancient post, the only ones that I have ever seen, to set it up as name.something.com.


----------



## SirDice (Aug 1, 2017)

Improvisor said:


> In your link, it is stated that this department is the department of last resort. In my case, it is.


The Generic section, yes. Not the Howto or Networking (where it's now) section.


----------



## Improvisor (Aug 1, 2017)

scottro said:


> I have a quickstart guide some have found useful.
> 
> http://srobb.net/fbsdquickwireless.html



Dear scottro, Many thanks. Indeed, I had used your tutorial before, which enabled me to discover that the detection of a signal had been lost. If, thanks to Phishfry, which see, I seek a signal, nothing but the devices are recognised, and so I can't go very far into your tutorial, which is nonetheless most educative.

Something has really gone haywire here; when I installed the system a day and a half ago, the ethernet (which ought to be spelly aethernet), the wireless, and sendmail all worked. When I removed the ethernet cable, everything seems to have gone to pieces. There is a bug noticed about this removing of the cable:-

http://freebsd.1045724.x6.nabble.co...i-in-hostap-mode-in-FreeBSD-11-td6119734.html

but the bug was stated to be repaired.

It took me an hour before I made my post to discover that what you have in the tutorial

sysctl.net.wlan.devices

ought to be

sysctl net.wlan.devices

without the first dot.

Always something!


----------



## Improvisor (Aug 1, 2017)

SirDice said:


> The Generic section, yes. Not the Howto or Networking (where it's now) section.



I stand (actually, sit) admonished.


----------



## Improvisor (Aug 1, 2017)

Phishfry said:


> You could also try FreeBSD built in tool:
> `bsdconfig wireless`



Many thanks indeed. I had been using bsdintall networking before; bsdinstall wireless makes more sense.

And, although it recognised the ssid, it indicated that no signal was detected, which is not the case, since I am writing this on a friend's brand-new Macintosh desktop, with a clear signal.

After using bsdinstallwireless, sendmail went into a panic so great that it froze command line. I did a hard shutdown with the power button, brought up the system, and now bsdintall wireless will not work; the prompt simply returns. Neither will bsdinstall network or networking.

The network has become a notwork.


----------



## Deleted member 30996 (Aug 1, 2017)

Improvisor said:


> But the only sure way to ensure pleasant behaviour from X under various applications, including Xfce, is to toss linux_load="YES" into /etc/rc.conf as well. Those three little lines of code save weeks of agony.



I believe this is what you want in /etc/rc.conf


```
linux_enable="YES"
```

I'm running with the NO flag and not experiencing any problems out of Fluxbox or any of my other programs.


----------



## Improvisor (Aug 1, 2017)

Many thanks. Interesting that you use "enable" rather than "load". When I try "enable", it seems to do nothing to check the "mtrr" error that X is prone to. Perhaps it is different in fluxbox? I am using the generic pkg add xfce, and it is working better than ever with no difficulties. There are little quirks in everything, and the empirical approach seems to be valid in this strange world of FreeBSD. Now, if only I could establish a stable working wireless and so forth...


----------



## Deleted member 30996 (Aug 1, 2017)

I've always used enable and have only seen load used for kernel modules IIRC. One other thing:



Improvisor said:


> But I noticed something unusual in /etc/rc.conf that I had never seen in versions older than 11.1, namely, a line ifconfig_alc0="WPAD". Entering % ifconfig informed me that this novelty had to do with the hard-wired ethernet. SInce the ethernet was working, I decided to leave well enough alone and get on with it.



I use

```
ifconfig_bge0="DHCP"
```
I wasn't familiar with WPAD so I looked it up and it appears to be Web Proxy Auto-Discovery Protocol.

I also found this article from 2016:

Disable WPAD now or have your accounts and private data compromised

You know what they say, if it ain't broke don't fix it. Question being, is it broke?


----------



## SirDice (Aug 1, 2017)

Improvisor said:


> Many thanks. Interesting that you use "enable" rather than "load". When I try "enable"


There is a difference. For /boot/loader.conf you use foo_load="YES", for rc.conf you use bar_enable="YES".

Simple short-hand, loader.conf is used to _load_ kernel modules, rc.conf is used to _enable_ services.


----------



## Improvisor (Aug 2, 2017)

Trihexagonal said:


> I've always used enable and have only seen load used for kernel modules IIRC. One other thing:
> 
> I use
> 
> ...



Many thanks. Please see my reply below to Sir Dice about load vs. enable.

I am grateful for your research on WPA, something assuredly to be avoided.

I was not not sure what I am doing at the beginning, and now I am even less sure.

As mentioned in my first post, I removed all configurations in the hope that some one here would be able to guide me step by step through the process of configuring the wireless; scottro's tutorial would work if I could get a recognised signal, but I can't. The ethernet went down after I tried bsdinstall wireless.

I am trying now simply to get the ethernet, alc0, working again.

So, I put the following back in 'etc/rc.conf:-

wlans_alc0="wlan0"
ifconfig_alc0="DHCP"

I am not sure if this be correct for the ethernet. My understanding is that the last on the list in rc.conf is the one that is tested first; if the system find no connexion, it moves back up the list. Perhaps I have got this order backwards.

So, as in my case, if one have one ethernet device and one wireless device, as may be seen in my reply to tingo above, then, in the absence of the attachment of the ethernet cable, the wireless will come alive.

Therefore, if I recollect aright, when I originally saw the rc.conf, there was only one line, I believe the ifconfig one, for the ethernet, whilst there were two lines, the wlans followed by the ifconfig, for the wireless, with the ethernet, alc0, above the wireless, ath0, which latter had both the ifconfig and the wlans.

In dealing with the issue of the linux_load vs. linux_enable, I vi-ed /boot/loader.conf. and found only one line:-

if_ath_load="YES"

I didn't put that there; perhaps it was entered automatically when I configured the wireless in the original installation script from the DVD. What, O what, can this mean?

Further, I deleted wpa_supplicant.conf from /etc in my cleanup after the downfall of the wireless, but the bdinstall wireless command still displayed the ssid. I looked into the actual directory, wpa_supplicant, by means of ls -aF, and was astonished by the quantity of directories and files therein presented to view. I did not want to touch it for fear of mangling the system, but it led me to wonder if there might be one or more duplicate wpa_supplicant.conf files. I created the one that I mention as having deleted, agreeably to the instructions in the Handbook.

Something is still odd here, and I'll wager that it is some very simple thing that is being overlooked. We know that we have the devices, we know that we have the signal, we know that the devices are recognised by the system, and now we have a working ethernet again, with no more nonsense with sendmail. What is the snag with the wireless?

Well, the boot message now says that the link state is up, and, wonder of wonders, the ethernet came back up in command line! I logged out of root into my user and gui, and firefox is working very well! Hurrah!

So, we have revived the ethernet from its near-death experience, and now we're back to dealing with the revivification of the wireless, ath0, for instructions as to doing which I am, like the donkey, all ears.


----------



## Improvisor (Aug 2, 2017)

SirDice said:


> There is a difference. For /boot/loader.conf you use foo_load="YES", for rc.conf you use bar_enable="YES".
> 
> Simple short-hand, loader.conf is used to _load_ kernel modules, rc.conf is used to _enable_ services.



Many thanks for the distinction. You have an interesting style of teaching, and I am grateful, for the results seem to stick in the memory.

I tried various permutations to see what would happen, as follows:-

1. In /etc/rc.conf only. linux_load="YES". In command line, usb loads well into /media. In user's gui, xfce, the usb's icon appears on the desktop, file manager displays the contents, and the usb may be mounted and unmounted by a right click on the icon. Status messages come and go as necessary with no delays.

2. This line commented out yields recognition in command line, ability to cat and vi, but no sign of usb in icon in gui, even if may be read and written to through file manager.

3. In /boot/loader.conf, linux_load="YES", but with the same commented out in /etc/rc.conf, restores original full functionality in the gui.

4. With linux_load="YES" in boot/loader.conf and uncommented in /etc/rc.conf, same result as 1 and 3.

5. With linux_load="YES" in boot/loader.conf commented out and uncommented in /etc/rc.conf, the same as 1, 3, and 4.

6. With linux_load="YES" in boot/loader.conf commented out and linux_load="YES" replaced by linux_enable="YES" in /etc/rc.conf, the icon appears, and the usb may be mounted and unmounted, but the "safe to remove volume" message does not go away in gui even after removal of the usb from the machine.

6. With linux_load="YES" in boot/loader.conf uncommented and linux_enable="YES" commented out in /etc/rc.conf, the same as 1, 3, 4, and 5.

7. With linux_load="YES" in boot/loader.conf uncommented and linux_enable="YES" uncommented  in /etc/rc.conf, the same as 1, 3, 4, 5, and 6.

Analysis. 
1. linux_enable="YES" by itself in /etc/rc.conf only is insufficient to yield full functionality.
2. linux_load="YES" by itself either in /etc/rc.conf or in /boot/loader.conf is sufficient to yield full functionality.

Conclusion. linux_load="YES" /boot/loader.conf is necessary, sufficient, and proper, and linux_enable="YES" in /etc/rc.conf is, although unnecessary and insufficient, nonetheless proper; wherefore, for the sake of propriety, I have put each statement in its proper file.

I may add that all of this nonsense has to do with the gui, and, as you have pointed out elsewhere, the gui and guisms have nothing to do with FreeBSD, which is sufficient unto itself in its own universe.


----------



## Deleted member 30996 (Aug 2, 2017)

Improvisor said:


> I am grateful for your research on WPA, something assuredly to be avoided.



Just trying to help a brother out.  I'm glad you got it working.


----------



## Improvisor (Aug 8, 2017)

Trihexagonal said:


> Just trying to help a brother out.  I'm glad you got it working.



And you are most helpful!

At this point, it has restored the hard-wired ethernet connection, but I remain at a loss as to what to do with the wireless. What I have tried is in my previous posting.

Following the instructions in the Handbook simply does not work this time, which is a surprise.

Would you have any further ingenious ideas?


----------

