# Fail to connect to internet with wifi key after connecting to router



## SIFE (Sep 13, 2011)

I have d-link DWA-125 wifi key and a router I configured ti use WPA protocol with AES encryption. Now, in my system i can access to router via http://192.168.1.1 but I can't reach the internet, I use wpa_supplicant to perform a connection to router. Here is my configuration I used:

```
/etc/wpa_supplicant.conf
ctrl_interface=/var/run/wpa_supplicant
ctrl_interface_group=wheel

network={
ssid="dlink"
#proto=RSN
#scan_ssid=1
wep_tx_keyidx=0 
key_mgmt=WPA-PSK
psk="my-password"
}
```


----------



## wblock@ (Sep 13, 2011)

That's half of it.  The other half is using DHCP to get an IP address.  That's done in /etc/rc.conf.


----------



## SIFE (Sep 13, 2011)

I forget to say I tried to get an ip from DHCP server like so:

```
dhclient wlan0
```
With above command I can only reach the router.


----------



## wblock@ (Sep 14, 2011)

What do you mean by "reach the router"?  If you can communicate with the router wirelessly, then wireless networking is working and any remaining problems are in the router.  The router might block pings or other useful stuff.


----------



## davidgurvich (Sep 16, 2011)

You've failed to set up DNS.  Can you ping 8.8.8.8? That's the ipv4 google DNS.  What's in your /etc/resolv.conf?


----------

