# Wireless usage issue under iwn0



## blixto (Jul 7, 2013)

Dear collagues,

I want to share a problem that I've just solved few minutes ago by sniffing out this forum looking for something that would help me in my quest through FreeBSD. I'm doing this in order to report a quick solution for newbies like me quickly find the answer they need.

*THE SITUATION*

I have a Dell INSPIRON N5110 core i3 laptop, with Intel Centrino wireless chip with ordinary 802.11x support. The installation went fine, no situations during any step of the setup process. Even the network configuration was fine, and FreeBSD was able to activate my wireless capacities and find my home network.

But, when I tried to fetch some packages through `pkg_add -r` then the output was that it was unable to look up for the FTP address it uses to download and set the packages normally.

Every time I ran the `ifconfig wlan0` command, it shown that it was dissociated from my network (no carrier). I tried to configure my network throught `sysinstall` with no success, tried to medle with `dhclient` and some .conf files with no success as well. I made a deep search into the Networking session of this forum and the topics were quite interesting, but the thing that really solved my problem was the line: `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B`. I've simply ran that command and the next time I executed the `ifconfig` command, it shown my wlan0 now associated to my home network.

*ABSTRACT*

If you're trying to put your wireless network to function properly in your system to download some packages or whatever, and you find your system recognizing properly your wireless device and even responds nicely to `ifconfig wlan0 list scan`, i.e. it actually shows your and your neighbors' networks, then the first thing you should try is:

Verify if the file wpa_supplicant.conf is written with the SSID of your network and your password.
If the previous item is OK, then just execute the command `wpa_supplicant -i wlan0 -c /etc/wpa_supplicant.conf -B`.
Those steps may solve your problems just like what happened to me. I'm not certain why it worked fine for me, but it worked.

This is just for a first try. If your situation matches mine closely, then it is very likely that those steps before solves your case too.

OK, guys. Now you're invited to give your opinions about how I obscurely solved my problem 

Thank you very much. This forum rocks.


----------



## wblock@ (Jul 7, 2013)

wpa_supplicant(8) is run automatically by the startup scripts when the network interface is configured to use WPA in /etc/rc.conf.  For example, for a iwn(4) network card:

```
wlans_iwn0="wlan0"
ifconfig_wlan0="WPA SYNCDHCP"
```

If changes are made to the files, restarting the netif startup script will make them take effect:
`# service netif restart`


----------



## blixto (Jul 8, 2013)

wblock@ said:
			
		

> wpa_supplicant(8) is run automatically by the startup scripts when the network interface is configured to use WPA in /etc/rc.conf.  For example, for a iwn(4) network card:
> 
> ```
> wlans_iwn0="wlan0"
> ...



Thanks for the tip.

I'm kinda of new to FreeBSD, and m_e_ddling with all these tricky configuration schemes with files, and commands etc confuses noobs like me.

Thanks God I have this forum.


----------



## wblock@ (Jul 8, 2013)

The Handbook is always the first place to check: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html.

I also have some articles on a bunch of FreeBSD subjects, including wireless, that you may find useful: http://www.wonkity.com/~wblock/docs/index.html.


----------



## blixto (Jul 9, 2013)

wblock@ said:
			
		

> The Handbook is always the first place to check: http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/index.html.
> 
> I also have some articles on a bunch of FreeBSD subjects, including wireless, that you may find useful: http://www.wonkity.com/~wblock/docs/index.html.



I've found your tutorial quite easier than the handbook chapter about setting wireless networks.

Yesterday I reconfigured the ENTIRE thing, made some new, nice and clean configuration files, including rc.conf etc, using the tips on your tutorial. The only thing I had to figure out myself was that instead of using SYNCDHCP I had to use DHCP. When I rebooted, everything went just fine, and the dhclient was able to locate the right offers and connect to the appropriate one.

Thanks very much for the support.


----------



## wblock@ (Jul 9, 2013)

blixto said:
			
		

> I've found your tutorial quite easier than the handbook chapter about setting wireless networks.



Great!



> The only thing I had to figure out myself was that instead of using SYNCDHCP I had to use DHCP.



They should be nearly the same.  The difference is that SYNCDHCP pauses and waits for dhclient(8) to get a lease before continuing with the startup, while DHCP runs dhclient(8) in the background and continues with the startup at the same time.  SYNCDHCP is usually safer, more often getting an IP address before later scripts need it.


----------

