*BSDThis forum is for the discussion of all BSD variants.
FreeBSD, OpenBSD, NetBSD, etc.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
ifconfig wlan0 create wlandev ath0
ifconfig wlan0 netmask 255.255.255.0 ssid mywifispot wepmode on weptxkey 1 wepkey 00myHexPassword
# wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf
# The line above is commented out because it doesn't work,
# it just hangs for about a minute then gives up.
But that is not enough. It seems I can't get DNS lookup or DHCP working correctly:
Code:
Script started on Fri Aug 5 23:41:46 2011
lucfree# sh connect.sh
lucfree# ping www.yahoo.com
ping: cannot resolve www.yahoo.com: Host name lookup failure
lucfree# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether xx:yy:xx:yy:xx:yy
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g
status: associated
ssid mywifispot channel 6 (2437 MHz 11g) bssid xx:yy:xx:yy:xx:yy
regdomain 101 indoor ecm authmode OPEN privacy ON deftxkey 2
wepkey 2:40-bit txpower 20 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL
lucfree# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 2290
ether xx:yy:xx:yy:xx:yy
media: IEEE 802.11 Wireless Ethernet autoselect mode 11g
status: associated
lucfree# dhclient wlan0
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 18
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
lucfree# ifconfig wlan0
wlan0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether xx:yy:xx:yy:xx:yy
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
media: IEEE 802.11 Wireless Ethernet DS/11Mbps mode 11g
status: associated
ssid mywifispot channel 6 (2437 MHz 11g) bssid xx:yy:xx:yy:xx:yy
regdomain 101 indoor ecm authmode OPEN privacy ON deftxkey 2
wepkey 2:40-bit txpower 20 bmiss 7 scanvalid 450 bgscan
bgscanintvl 300 bgscanidle 250 roam:rssi 7 roam:rate 5 protmode CTS
wme burst roaming MANUAL
lucfree# route add default 192.168.1.1
route: writing to routing socket: Network is unreachable
add net default: gateway 192.168.1.1: Network is unreachable
lucfree# netstat -rn
Routing tables
Internet:
Destination Gateway Flags Refs Use Netif Expire
0.0.0.0/8 link#4 U 0 0 wlan0
127.0.0.1 link#3 UH 0 0 lo0
Internet6:
Destination Gateway Flags Netif Expire
::1 ::1 UH lo0
fe80::%lo0/64 link#3 U lo0
fe80::1%lo0 link#3 UHS lo0
ff01:3::/32 fe80::1%lo0 U lo0
ff02::%lo0/32 fe80::1%lo0 U lo0
lucfree# cat /etc/resolv.conf
domain lucfree
nameserver 192.168.1.1
lucfree# exit
Script done on Fri Aug 5 23:47:59 2011
My Wifi connection works fine on two Linux distros I have been using for several years (using one to post this right now), so hardware failure is ruled out. I am just not well versed in FreeBSD. Anybody help?
There's a few issues here -- may as well start addressing them one by one.
First, your rc.conf(5) is currently a mess, and needs to be cleaned up. Do not use sysinstall(8) to edit it. Instead, edit it manually. Yours, in particular, should look something like:
Code:
hostname="lucfree.local" # NOTE that I made it FQ by adding .local
moused_enable="YES"
sshd_enable="YES"
# Use your real WEP key here
ifconfig_ath0="wepmode on weptxkey 3 wepkey 3:0x1234567890 ssid YOUR_SSID DHCP"
The rest of the cruft in there needs to go away. If you configure this manner, you should not need to use wpa_supplicant.conf(5).
---
Second, for WEP, in /boot/loader.conf, add:
Code:
# Technically, only this first module is needed.
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
After you've added that, you can avoid a reboot with: # kldload wlan_wep
---
Third, you don't need a custom script to test this connection. You can use: /etc/rc.d/netif restart
... and let that process suck in your rc.conf(5). That way you get to test that it's configured correctly at the same time.
---
P.S. WEP sucks. Please consider looking into an AP that supports WPA.
However, it still does not work. It got worse, my machine won't even associate with the wifi spot.
It seems to associate when I run the first line of my connect.sh script, but then I'm still stuck in the same problem, no resolving. Note that I can't even ping sites by their IP numbers. I can't even ping the router at 192.168.1.1. The only number I can ping is 127.0.0.1.
Quote:
Originally Posted by anomie
P.S. WEP sucks. Please consider looking into an AP that supports WPA.
I am aware of how weak WEP is, but the access point isn't mine. I inquired the owner about it once, it seems that there is or used to be someone in the house using a machine that cannot/could not use WPA2, so they decided to leave it that way. I figure I had better not meddle in their business. I use SSH tunnels for all my important stuff anyway.
Sorry, let me take another stab at the rc.conf(5). Try:
Code:
hostname="lucfree.local" # NOTE that I made it FQ by adding .local
moused_enable="YES"
sshd_enable="YES"
wlans_ath0="wlan0"
# Use your real WEP key here
ifconfig_wlan0="wepmode on weptxkey 3 wepkey 3:0x1234567890 ssid YOUR_SSID DHCP"
And please use /etc/rc.d/netif instead of messing with a custom script. The reasoning is even if you get connect.sh working, you'll have to translate it into rc.conf(5) parlance if you want it to survive a reboot. Might as well kill two birds with one stone.
If it's still not working after the (above) changes, then I recommend starting to eliminate possible causes: make it an open AP, then get that working, so we know the hardware and DHCP server are most likely doing their thing (at which point either the WEP configuration or the WEP driver w/ your hardware are probably causing the issues).
Sorry, let me take another stab at the rc.conf(5). Try:
Code:
hostname="lucfree.local" # NOTE that I made it FQ by adding .local
moused_enable="YES"
sshd_enable="YES"
wlans_ath0="wlan0"
# Use your real WEP key here
ifconfig_wlan0="wepmode on weptxkey 3 wepkey 3:0x1234567890 ssid YOUR_SSID DHCP"
And please use /etc/rc.d/netif instead of messing with a custom script. The reasoning is even if you get connect.sh working, you'll have to translate it into rc.conf(5) parlance if you want it to survive a reboot. Might as well kill two birds with one stone.
If it's still not working after the (above) changes, then I recommend starting to eliminate possible causes: make it an open AP, then get that working, so we know the hardware and DHCP server are most likely doing their thing (at which point either the WEP configuration or the WEP driver w/ your hardware are probably causing the issues).
Thank you again. Your new suggestion has been tried here already. It's the recommended procedure in the documentation to which I referred in my first post. It doesn't work. FreeBSD creates wlan0 and claims to be associated with the Access Point, but cannot resolve any address except 127.0.0.1, not even the router at 192.168.1.1. I remember seeing some error message(s) stating that "wlan0 is down" even after I ran 'ifconfig wlan0 up.'
Also, like I said before, I am not allowed to tinker with the Access Point and make it more or less open. I have to use it as is.
I can only blame FreeBSD so far since I have Windows XP and two Linux distros in this very same machine and same network/AP, and the three of them work fine. Four if we count System Rescue CD, which also finds, authenticates and uses my Wifi connection very easily.
Does FreeBSD 8.2 come with any firewall enabled by default? How can I check that? If so, how can I disable it?
No, there's no firewall enabled by default. You could test to see whether IPFW or PF are loaded pretty easily with:
Code:
# kldstat | egrep ' pf| ipfw'
I don't have any particularly elegant suggestions from here. The way I would troubleshoot it is, as I mentioned, find some way to eliminate possibilities. If the AP can not be reconfigured, can a new one temporarily be brought in? If not, can the computer be temporarily moved?
It's trial and error / tinkering / re-check configurations time. Device support via ath(4) is good, but keep an eye on /var/log/messages for chatter about problems about your wifi device.
I gave up on FreeBSD, tried NetBSD and had the same problem. Then I googled the hell out of it and realized there is no documentation explaining how to set up DHCP on any of the BSDs. Not only that, my google search brought up one or two people making the same complaint.
Finally, I tried OpenBSD. It wouldn't install.
So I gave up on all the BSDs. They hate me. They have for a long time.
So I gave up on all the BSDs. They hate me. They have for a long time.
Did you report any of the problems you've had? I mean, to the appropriate mailing list?
I know it may not help what you're dealing with here and now, but reporting issues does help open source projects correct errors and become more robust.
I'm actually a bit interested to know how OpenBSD failed, was it a disk controller that wasn't properly recognized? ACPI issues? Just curious...
I'm actually a bit interested to know how OpenBSD failed, was it a disk controller that wasn't properly recognized? ACPI issues? Just curious...
From memory, it was something like this: installer asked me if I wanted to use whole disk or just a DOS partition (slice). I chose slice. Then it asked if I wanted to edit disklabel or (A)uto configure, or something like that. In either case, I got back to the part that asked me whether I wanted to use whole disk or just a slice. I selected slice. Then it asked if I wanted to edit disklabel or (A)uto configure, or something like that... Do you get it? I couldn't get out of that loop.
After four reboots and several attempts at that loop, I got angry and confused and pressed something at random (I know!) and told installer to use the whole disk. Disaster ensued, I watched OpenBSD beginning to format my disk, I pressed Ctrl+c after a few seconds, but of course that was too late. I lost my partition table and maybe one of my slices too. I had backups, but they were not thorough, so I used recovery software to put the disk back in its original state. I recovered all my data. My point is, the installer won't let me install OpenBSD in its own slice, it wants to use the entire disk. Either that or trap me in a loop of the same questions over and over.
If that report is not enough, I can try it again, but not too soon. A few days later.
The only thing I can think of that would cause that is that OpenBSD is expecting a primary partition and none are available (though that would affect {Net,Free}BSD as well, I would imagine?).
And no worries, there's no need to risk your data again. Thanks for the clarification. =)
I recommend starting to eliminate possible causes: make it an open AP, then get that working, so we know the hardware and DHCP server are most likely doing their thing (at which point either the WEP configuration or the WEP driver w/ your hardware are probably causing the issues).
While I normally like your advice here, I disagree on this. He knows others are able to connect to it and his two Linux boxes connect. The AP isn't the problem IMHO.
I gave up on FreeBSD, tried NetBSD and had the same problem. Then I googled the hell out of it and realized there is no documentation explaining how to set up DHCP on any of the BSDs. Not only that, my google search brought up one or two people making the same complaint.
Professional documentation writer here.
BSD's documentation is not written by professionals. It is a volunteer effort. It is not bad, per se, but it's unfriendly.
So are the mailing lists. You will find an attitude of "blame the user."
Not all BSDites are like this. Some recognize that making a server operating system work on the desktop takes more than some verbose documentation and hostile e-lists.
As far as your question, I haven't yet tried WiFi on BSD yet so have no useful information. I am sorry for this.
BSD's documentation is not written by professionals. It is a volunteer effort. It is not bad, per se, but it's unfriendly.
So are the mailing lists. You will find an attitude of "blame the user."
I know. I won't even try them anymore.
The NetBSD community is the only one that has always struck me as friendly, but it is very small and underpowered, they want to help, but are often unable to. I mean, they usually don't have the answers.
OpenBSD is the most hostile, will actively drive neophites away.
FreeBSD tends to just simply ignore request for help from newbies. They figure everything is in the must-read thousand-page handbook, even if inadequately put, so questions like "how do I set up Wifi" are almost anathema. Even if the official instructions don't work.
I still bother because I like to test operating systems, I'd love to give the BSDs a try. But there are too many obstacles in place.
While I normally like your advice here, I disagree on this. He knows others are able to connect to it and his two Linux boxes connect. The AP isn't the problem IMHO.
Problem is I don't have a FreeBSD installation with wifi these days, so I'm going from my own memory, and from the official docs. If the usual course of configuration doesn't work, the best I could / can offer is my default of starting from the basics and working upward. Even if it does not seem like the most logical approach given all the details together, my experience has been that such an exercise often turns on a little light bulb or two that can help troubleshoot.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.