# ath0 wifi, how is it to use it?



## raxeax (Jan 30, 2009)

hi,
sorry if this seem repeated or noob question.

but how is it the correct way to use ath0 wifi on this presario F762AU laptop?

btw, running FreeBSD 7.1 release here.

my /etc/wpa_supplicant.conf is like below

```
network={
 ssid="THESTAR"
 scan_ssid=1
 key_mgmt=NONE
 wep_key1=1234567890
 wep_tx_keyidx=1
}
```

i did the following with the hope to connected to wifi and ping www.google.com

```
# wpa_supplicant -i ath0 -c /etc/wpa_supplicant.conf
Trying to associate with 00:25:e9:e1:8e:88 (SSID='THESTAR' freq=2417 MHz)
Associated with 00:25:e9:e1:8e:88
CTRL-EVENT-CONNECTED - Connection to 00:25:e9:e1:8e:88 completed (auth) [id=0 id_str=]
```
then the console screen halt without giving me a # unless i do Ctrl + C.

i press ALT + F2 to start another console screen

```
# ifconfig ath0
ath0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
ether 00:1f:4a:9e:d9:25
inet 0.0.0.0 netmask 0xff000000 broadcast 255.255.255.255
media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
status: associated
ssid THESTAR channel 2 (2417 Mhz 11g) bssid 00:25:e9:e1:8e:88
automode OPEN privacy ON deftxkey 2 wepkey 2:40-bit txpower 31.5
bmiss 7 scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250
roam:rssi11g 7 roam:rate11g 5 protmode CtS burst roaming MANUAL
```

i suspect i don't get the IP address.
but.

in etc/rc.conf
i already specified.

```
ifconfig_ath0="authmode open wepmode mixed DHCP"
```

my boot/loader.conf is like below

```
if_ath_load="YES"
wlan_scan_ap_load="YES"
wlan_scan_sta_load="YES"
wlan_wep_load="YES"
```

where could be wrong??? clueless..


----------



## SirDice (Jan 30, 2009)

http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/network-wireless.html


----------



## raxeax (Jan 30, 2009)

i visited that url already and went through it before i posted here.
i thought it displayed quite well from what i had posted.


----------



## SirDice (Jan 30, 2009)

raxeax said:
			
		

> i visited that url already and went through it before i posted here.
> i thought it displayed quite well from what i had posted.



Read the handbook again.. You skipped the dhclient bit


----------



## raxeax (Jan 30, 2009)

i actually manually launch the dhclient ath0 before, but it doesn't works.

```
# dhclient ath0
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 8
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 9
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
#
```
but this wifi thingy is working on this win7 laptop that i am using now to visit this forum.


----------



## raxeax (Jan 31, 2009)

hiredman in ##freebsd freenode.net helps me solved this problem 
!!! very big thanks to him/her (God knows)

so.. suggested step is like below.

remove the
wlan_scan_ap_load="YES"
from /boot/loader.conf

then change
 wep_key1=1234567890
 wep_tx_keyidx=1
to wep_key0 and wep_tx_keyidx=0

coz.... we are using the first key on the wifi router.

/etc/rc.d/netif restart ath0

and you got it !!!!
very big thanks to this samaritan.


----------



## raxeax (Jan 31, 2009)

i miss one thing
change ifconfig_ath0="authmode open wepmode mixed DHCP"
to
ifconfig_ath0="DHCP WPA"


----------



## kasse (Feb 1, 2009)

I have a wireless problem with d-link g520. (I hope I have not missed anyting obvious in the handbook)
From what I understand this device is supported. The card is does not transmit anything. I get not arp tables, my pings do not go out etc nothing...
The  card works on the same computer with debian and netbsd.

Card: D-Link DWL-G520,   H/W Ver: B4,     F/W Ver 4.40

The data are: Freebsd 7.1-release

```
$ dmesg |less
ath_hal: 0.10.5.6 (AR5210, AR5211, AR5212, AR5416, RF5111, RF5112, RF2413, RF5413, RF2133, RF2425, RF2417)

ath0: <Atheros 5212> mem 0xff8f0000-0xff8fffff irq 19 at device 10.0 on pci1
ath0: [ITHREAD]
ath0: WARNING: using obsoleted if_watchdog interface
ath0: Ethernet address: 00:22:b0:5d:19:23
ath0: mac 7.9 phy 4.5 radio 5.6
```


```
$ kldstat -v | grep ath
		62 ath_hal
		63 ath_rate
		64 cardbus/if_ath
		65 pci/if_ath
$ kldstat -v | grep wlan
		212 wlan_amrr
		213 wlan_ccmp
		214 wlan_tkip
		215 wlan_wep
		216 wlan
		217 wlan_scan_ap
		218 wlan_scan_sta
```


```
$ ifconfig ath0
ath0: flags=8943<UP,BROADCAST,RUNNING,PROMISC,SIMPLEX,MULTICAST> metric 0 mtu 1500
	ether 00:22:b0:5d:19:23
	inet 192.168.0.107 netmask 0xffffff00 broadcast 192.168.0.255
	media: IEEE 802.11 Wireless Ethernet autoselect (OFDM/36Mbps)
	status: associated
	ssid locnet channel 6 (2437 Mhz 11g) bssid 00:13:46:42:6e:10
	authmode OPEN privacy ON deftxkey UNDEF wepkey 1:104-bit txpower 31.5
	bmiss 7 scanvalid 60 bgscan bgscanintvl 300 bgscanidle 250
	roam:rssi11g 7 roam:rate11g 5 protmode CTS burst
```


```
$ netstat -rn
Routing tables

Internet:
Destination        Gateway            Flags    Refs      Use  Netif Expire
default            192.168.0.1        UGS         0   182043   ath0
127.0.0.1          127.0.0.1          UH          0        2    lo0
192.168.0.0/24     link#1             UC          0        0   ath0
```


```
$ ifconfig ath0 scan
SSID            BSSID              CHAN RATE   S:N     INT CAPS
locnet          00:13:46:42:6e:10    6   54M -86:-96  100 EPS
```


```
$ arp -a
```
if i try to ping the router:

```
$ sudo tcpdump -vvv -i ath0
tcpdump: listening on ath0, link-type EN10MB (Ethernet), capture size 96 bytes
18:40:26.659886 arp who-has 192.168.0.1 tell 192.168.0.107
18:40:27.368581 arp who-has 192.168.0.1 tell 192.168.0.107
18:40:32.368859 arp who-has 192.168.0.1 tell 192.168.0.107
18:40:42.369852 arp who-has 192.168.0.1 tell 192.168.0.107
18:40:47.370458 arp who-has 192.168.0.1 tell 192.168.0.107
18:41:01.353691 arp who-has 192.168.0.1 tell 192.168.0.107
18:41:06.353947 arp who-has 192.168.0.1 tell 192.168.0.107
```


```
$ sysctl -a |grep ath

net.wlan.0.%parent: ath0

dev.ath.0.%desc: Atheros 5212
dev.ath.0.%driver: ath
dev.ath.0.%location: slot=10 function=0
dev.ath.0.%pnpinfo: vendor=0x168c device=0x0013 subvendor=0x1186 subdevice=0x3a13 class=0x020000
dev.ath.0.%parent: pci1
dev.ath.0.smoothing_rate: 95
dev.ath.0.sample_rate: 10
dev.ath.0.countrycode: 0
dev.ath.0.regdomain: 48
dev.ath.0.slottime: 9
dev.ath.0.acktimeout: 48
dev.ath.0.ctstimeout: 48
dev.ath.0.softled: 0
dev.ath.0.ledpin: 0
dev.ath.0.ledon: 0
dev.ath.0.ledidle: 2700
dev.ath.0.txantenna: 0
dev.ath.0.rxantenna: 1
dev.ath.0.diversity: 0
dev.ath.0.txintrperiod: 5
dev.ath.0.diag: 0
dev.ath.0.tpscale: 0
dev.ath.0.tpc: 0
dev.ath.0.tpack: 63
dev.ath.0.tpcts: 63
dev.ath.0.fftxqmin: 2
dev.ath.0.fftxqmax: 50
dev.ath.0.monpass: 24
```

from /var/log/messages

```
Feb  1 16:29:08 Dell sudo:   viktor : TTY=ttyp0 ; PWD=/var/log ; USER=root ; COMMAND=/sbin/route change default
 -ifp ath0
Feb  1 16:29:25 Dell sudo:   viktor : TTY=ttyp0 ; PWD=/var/log ; USER=root ; COMMAND=/sbin/route change -net 19
2.168.0.0 -interface ath0 -ifp ath0
Feb  1 16:29:50 Dell kernel: ath0: can't handle af18
Feb  1 16:29:51 Dell kernel: ath0: can't handle af18
```

Other computers in the network does not see my pings, but when they ping me I get their arp entries. But even after this I cannot transmit anything.


----------



## honk (Feb 17, 2009)

From your ifconfig:
"...authmode OPEN privacy ON deftxkey *UNDEF wepkey 1:104-bit* txpower 31.5..."

How did you set up WEP?

cheers,
honk


----------



## kasse (Feb 20, 2009)

honk said:
			
		

> From your ifconfig:
> "...authmode OPEN privacy ON deftxkey *UNDEF wepkey 1:104-bit* txpower 31.5..."
> 
> How did you set up WEP?
> ...


Thanks,
I am sorry for the late reply, perhaps it was the wepkey. I am using wpa_supplicant now and it is working. I configured the wepmode about the same as in netbsd, with ifconfig nwid XXXX nwkey YYYY, and the wepmode was on.
It was weird that I got their "arp-info" when they pinged me, but they could not see anything from me. Perhaps it is possible to get that arp info without being properly "associated" with the network. 

But no luck with authpf :\


----------

