# Configure wireless ?



## juve_inferno (Dec 19, 2009)

I have FreeBSD 8.0 and ath interface. How to configure wireless to connect to internet over WPA?


----------



## Nightweaver (Dec 19, 2009)

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html and http://forums.freebsd.org/showthread.php?t=8747&highlight=wlan0


----------



## juve_inferno (Dec 19, 2009)

I create wlan0 device, configure loader.conf and wpa_supplicant.conf

```
network={
ssid="D-Link"
psk="****" 
}
```
In list i see my wireless network but when type dhclient wlan0 there are message wlan0: no link ......


----------



## mickey (Dec 19, 2009)

juve_inferno said:
			
		

> I create wlan0 device, configure loader.conf and wpa_supplicant.conf
> 
> ```
> network={
> ...



That is probably cause you didn't start wpa_supplicant first, which will bring up the link on the interface, when it successfully associated to your AP.

What settings did you put into your /etc/rc.conf file? You will need something like this:

```
wlans_ath0="wlan0"
create_args_wlan0="regdomain XXX country YYY"
ifconfig_wlan0="WPA DHCP"
```
Replace XXX and YYY in the above with the correct regdomain and country name for your locale. You can use the following to find out, which regdomains and countries are supported:
`# ifconfig wlan0 list countries | more`

Once you have those settings in your /etc/rc.conf file, the interface should be brought up automatically on the next reboot.


----------



## juve_inferno (Dec 19, 2009)

Is there a way to connect manual with commands? Because each change in network i would have to reset computer.
/boot/loader.conf

```
wlan_wep_load="YES"
wlan_ccmp_load="YES"
wlan_tkip_load="YES"
```
/etc/rc.conf

```
wlans_ath0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
wpa_supplicant.conf

```
network={
ssid="D-Link"
psk="****" 
}
```

I try with SSID Broadcast enabled and disabled but nothing. Router is configured to United States region.


----------



## mickey (Dec 19, 2009)

juve_inferno said:
			
		

> Is there a way to connect manual with commands? Because each change in network i would have to reset computer.



You can have multiple _network_ blocks defined in your /etc/wpa_supplicant.conf file. wpa_supplicant will then automatically switch networks, depending upon availability. If multiple networks are available simultaneously, you can assign priority values to each network block, in order to tell wpa_supplicant, which network it shall prefer over the other.

In general there's no point in doing that manually, and wpa_supplicant does a pretty good job, when configured correctly.



			
				juve_inferno said:
			
		

> I try with SSID Broadcast enabled and disabled but nothing. Router is configured to United States region.



Do you have the following set in your /etc/wpa_supplicant.conf?

```
ap_scan=1
```


----------



## juve_inferno (Dec 19, 2009)

Now when call ifconfig wlan0 is connected to my wireless network but when ping some web site or router "No route to host". Router assigns IP addresses based on MAC addresses of card.


----------



## mickey (Dec 20, 2009)

juve_inferno said:
			
		

> Now when call ifconfig wlan0 is connected to my wireless network but when ping some web site or router "No route to host". Router assigns IP addresses based on MAC addresses of card.



What is the output of [CMD=]ifconfig wlan0[/CMD] and [CMD=]netstat -rn[/CMD] ?


----------

