# Connected to router, but can't connect to anyone

## claytonl

Hey,

I'm using a TP-Link TL-WN321G with the kernel 2.6.31-r6 and I seem to have everything set up properly because I can browse for networks and connect to networks, but besides not being able to browse the internet or anything, I can't even ping google while I'm connected. It just says "ping: unknown host google.ca". Nothing works. Can't even ping the router. I don't get it and I have no clue why it doesn't work. Its a WEP connection. On a mac it connects fine and works. Any ideas?

----------

## knifeyspoony

What program are you using to connect to the network? What commands or GUI operations? Are you able to connect to other networks that way? Other WEP-protected networks? 

Once you are connected, can you post the outputs of ifconfig iface and iwconfig iface here?

----------

## Telemin

It sounds like your computer is either not being assigned an address or the routing is not being set up properly.

Are you running a DHCP server on your router?  If you don't know what that means then I shall presume you are as it the out of the box default for these things.

What happens if once you've made the connection you run:

```

dhcpcd iface

```

where iface will most likely be wlan0 or eth1.

-Freestyling-

----------

## Hu

Also, please post the output of nl /etc/resolv.conf ; ping -c4 74.125.67.103.  That IP address is one of several assigned to google.ca, according to the nameserver I use.  Errors about unknown hosts usually involve some sort of DNS problem, but it is too soon to tell whether it is that you have no DNS server at all, or that you have a DNS server which is not serving useful information.

----------

## Telemin

Hu

I would point out that at this point in time from the information that Claytonl has given us, as he cannot even ping his own router that DNS issues are secondary and that it is more likely routing or dhcp that is the issue.

I would imagine that the most likely problem is that for some reason the adapter is being configured with an autoconf ip address, it has happened to me for several reasons, usually annoying firewall problems.

-Freestyling-

----------

## xibo

set your internet address into the routers' subnetwork and use arping to see if it's there. alternately use ping and check the arp tables ( /proc/net/arp ) by hand if there are no replies to ping (icmp block or so).

----------

## claytonl

So I'm using ifconfig to set my wlan0 to the right channel, essid, and key, then I'm using dhcpcd to connect. It tells me that its leased 192.168.1.103 for 86400 seconds. Heres the requested output:

wlan0     Link encap:Ethernet  HWaddr 00:25:86:ed:12:c0  

          inet addr:192.168.1.103  Bcast:192.168.1.255  Mask:255.255.255.0

          inet6 addr: fe80::225:86ff:feed:12c0/64 Scope:Link

          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

          RX packets:510 errors:0 dropped:0 overruns:0 frame:0

          TX packets:13 errors:0 dropped:0 overruns:0 carrier:0

          collisions:0 txqueuelen:1000 

          RX bytes:110648 (108.0 KiB)  TX bytes:1640 (1.6 KiB)

wlan0     IEEE 802.11bg  ESSID:"hello neighbour"  

          Mode:Managed  Frequency:2.462 GHz  Access Point: 00:21:29:AB:70:07   

          Bit Rate=1 Mb/s   Tx-Power=8 dBm   

          Retry  long limit:7   RTS thr:off   Fragment thr:off

          Encryption key:xxxx-xxxx-xx

          Power Management:on

          Link Quality=54/70  Signal level=-56 dBm  

          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0

          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

PING 74.125.67.103 (74.125.67.103) 56(84) bytes of data.

From 192.168.1.103 icmp_seq=2 Destination Host Unreachable

From 192.168.1.103 icmp_seq=3 Destination Host Unreachable

From 192.168.1.103 icmp_seq=4 Destination Host Unreachable

--- 74.125.67.103 ping statistics ---

4 packets transmitted, 0 received, +3 errors, 100% packet loss, time 2999ms

, pipe 3

xibo, I'd do what you're asking but I'm entirely sure how. Sorry. /proc/net/arp gave me 3 different things. I did it the first time to see, and I BELIEVE it showed me this (I didn't write it down):

IP address       HW type     Flags       HW address            Mask     Device

192.168.1.1      0x0         0x0         00:00:00:00:00:00     *        wlan0

Then when I >'ed it (I'm sure theres a word for it but I don't know it) to a file to put on here and when I went to copy it from there it said:

IP address       HW type     Flags       HW address            Mask     Device

192.168.1.1      0x1         0x2         00:21:29:ab:70:05     *        wlan0

and then when I noticed this I did it again and it gave me this:

IP address       HW type     Flags       HW address            Mask     Device

Like I said, I'm not entirely sure if this has any significance but it seems weird to me.

----------

## Telemin

Sorry one more thing I forgot to ask you to post, the output of "route -n"

--EDIT--

In fact to speed things up try running:

```

route add default dev wlan0 gw 192.168.1.1

```

and then see if you can ping your router.

-Freestyling-

----------

## claytonl

Route -n was the first thing I checked and heres the output:

Kernel IP routing table

Destination     Gateway         Genmask         Flags Metric Ref    Use Iface

192.168.1.0     0.0.0.0         255.255.255.0   U     0      0        0 wlan0

127.0.0.0       0.0.0.0         255.0.0.0       U     0      0        0 lo

0.0.0.0         192.168.1.1     0.0.0.0         UG    0      0        0 wlan0

I wasn't able to do route add default dev wlan0 gw 192.168.1.1 and it says SIOCADDRT: File exists

----------

## claytonl

So no one has any idea?

----------

## Telemin

Sorry for the slow reply!

Oddly your configurations are - as far as I can tell - completely correct and in theory you should be getting at least ICMP ping replies from a router at 192.168.1.1 with that.

The other possibilities for what may be wrong include router config being set strangely and of course the ever present driver issues.

Networking is very much a black art, and in Linux the job is made even harder due to the fact that most drivers are produced by following manufacturers spec sheets at best and at worst reverse engineering.  This means that all the little foibles and peculiarities that wireless chipsets have are only found by trial and error in linux.

I presume you are using the rt73usb driver from in the linux kernel?  If so you may find some more knowledgeable help at the rt2x00 driver forums and wiki.

Sorry I can't give you an answer to this, I feel your pain though, on my first foray into linux it took me three months and my own kernel patch to get my wifi card working.

-Freestyling-

----------

