# Connecting to internet dhclient fails



## zjames (Sep 6, 2010)

I installed freebsd a few days ago and have been having difficulty connecting to the internet through my wireless.  When I scan for networks, I can find my wireless network, but when I do 
`# ifconfig`
the status line of the output says

```
status: no carrier
```
I tried ifconfig before using 
`#  /etc/rc.d/netif start`
and the output said

```
status: associated
```
I then tried
`#  dhclient wlan0`
and this failed, so I reran
`#  /etc/rc.d/netif start
# dhclient wlan0`
and got the following as output:

```
Wlan0: no link.............. giving up
```
Can anyone help me?


----------



## Romanrp (Sep 6, 2010)

Can you please post your /etc/rc.conf 
and maybe even your /etc/wpa_supplicant.conf


----------



## zjames (Sep 6, 2010)

/etc/rc.conf:

```
wlans_wpi0="wlan0"
ifconfig_wlan0="ssid linksys wepmode on weptxkey 1 wepkey ********** DHCP"
```
/etc/wpa_supplicant.conf:

```
network={
   ssid="linksys"
   key mgmt=NONE
   wep_key0=**********
   wep_tx_keyidx=0
}
```
/boot/loader.conf:

```
if_wpi_load="YES"
legal.intel_wpi.license_ack=1
wlan_wep_load="YES"
wlan_tkip_load="YES"
wlan_ccmp_load="YES"
```


----------



## Romanrp (Sep 6, 2010)

Have you tried changing the  

```
ifconfig_wlan0="ssid linksys wepmode on weptxkey 1 wepkey ********** DHCP"
```
to

```
ifconfig_wlan0="ssid linksys wepmode on weptxkey 0 wepkey ********** DHCP"
```


----------



## davidgurvich (Sep 7, 2010)

I would suggest using wpa_supplicant.conf as that seems to solve many of the issues I had with wep.
	
	



```
# Let all users in wheel use wpa frontend
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

# Home network
network={
	ssid="myssid"
	key_mgmt=NONE
	wep_tx_keyidx=0
	wep_key0=my_hex_key
	priority=10
}

network={
	key_mgmt=NONE
}
```
and relevant rc.conf
	
	



```
#wireless
wlans_ral0="wlan0"
ifconfig_wlan0="WPA DHCP"
```
The first entry is my home wep network and the second is to connect with dhcp to any open network.  That actually allows for wireless roaming if you move from spot to spot though you may have to wait to reconnect.


----------



## zjames (Sep 7, 2010)

I tried what you suggested, and I still get 

```
status: no carrier
```
Even if I do
`# ifconfig`
before
`#  /etc/rc.d/netif start`
Another thing which changed is that the ssid line of the output on ifconfig says:

```
ssid "" channel 132 (5660 MHz 11a)
```
I performed a scan, and was able to find my wireless network.


----------



## zjames (Sep 9, 2010)

I tried 
`#  /etc/wpa_supplicant.conf`
and got this error message:

```
permission denied
```
so I tried
`#  /etc/wpa_supplicant -Dwpi -iWlan0 -c/etc/wpa_supplicant.conf`
I tried this with 'wpi' and 'wpi0', but in both cases got

```
unsupported driver: wpi
```
I then tried 
`# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B`
and got this as the output:

```
Line 5: unknown network field 'key MGMT'.
Line 9: WPA-PSK accepted for key management, but no psk configured.
Line 9: failed to parse network block.
Line 12: unknown network field 'key MGMT'.
Line 13: failed to parse network block.
Failed to read or parse configuration '/etc/wpa_supplicant.conf'.
```


----------



## SirDice (Sep 9, 2010)

zjames said:
			
		

> I tried
> `#  /etc/wpa_supplicant.conf`
> and got this error message:
> 
> ...


That's correct. You're trying to execute a configuration file.


The correct way to start wpa_supplicant is:
`# /etc/rc.d/wpa_supplicant start`


----------



## wblock@ (Sep 9, 2010)

zjames said:
			
		

> I tried
> `# wpa_supplicant -iwlan0 -c/etc/wpa_supplicant.conf -B`
> and got this as the output:
> 
> ...


----------



## zjames (Sep 9, 2010)

Thanks for all thee help guys, I'd just missed out an underscore.


----------

