LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (http://www.linuxquestions.org/questions/slackware-14/)
-   -   Internet doesn't work despite being connected (WIFI) (http://www.linuxquestions.org/questions/slackware-14/internet-doesnt-work-despite-being-connected-wifi-4175495020/)

Holering 02-15-2014 08:41 AM

Internet doesn't work despite being connected (WIFI)
 
Network manager icon (nm-applet) shows my wifi connected to access point with ip address but internet doesn't work. Links stays looking up host forever and wget can't download.

Only work around is dhclient. I don't even need to give a passphrase-key via iwconfig since nm-applet (NetworkManager) has already done that (and is supposedly connected).

What would cause this?

Regards

mrclisdue 02-15-2014 09:52 AM

When you're connected via nm-applet, and you don't have internet access, what are the outputs of:
# route and # less /etc/resolv.conf ?

How does this change when you issue:

# dhclient


cheers,

tronayne 02-15-2014 10:25 AM

If you don't have any entries in /etc/resov.conf, try entering these:
Code:

search com
# Google Free DNS Servers
nameserver 8.8.8.8
nameserver 8.8.4.4

(if you know your ISPs DNS server address(es), enter those instead).

Once done, try
Code:

ping -c 5 news.google.com
PING news.l.google.com (74.125.224.201) 56(84) bytes of data.
64 bytes from lax02s02-in-f9.1e100.net (74.125.224.201): icmp_seq=1 ttl=55 time=733 ms
64 bytes from lax02s02-in-f9.1e100.net (74.125.224.201): icmp_seq=2 ttl=55 time=575 ms
64 bytes from lax02s02-in-f9.1e100.net (74.125.224.201): icmp_seq=3 ttl=55 time=578 ms
64 bytes from lax02s02-in-f9.1e100.net (74.125.224.201): icmp_seq=4 ttl=55 time=613 ms
64 bytes from lax02s02-in-f9.1e100.net (74.125.224.201): icmp_seq=5 ttl=55 time=613 ms

--- news.l.google.com ping statistics ---
5 packets transmitted, 5 received, 0% packet loss, time 4316ms
rtt min/avg/max/mdev = 575.139/622.937/733.473/57.681 ms

You should see the above.

Hope this helps some.

kikinovak 02-15-2014 11:37 AM

Quote:

Originally Posted by Holering (Post 5118170)
Network manager icon (nm-applet) shows my wifi connected to access point with ip address but internet doesn't work. Links stays looking up host forever and wget can't download.

Only work around is dhclient. I don't even need to give a passphrase-key via iwconfig since nm-applet (NetworkManager) has already done that (and is supposedly connected).

What would cause this?

Regards

What's your wireless card? What does the following command return:

Code:

# lspci | grep -i net
Some cards like Broadcom wireless cards only have poor support unless you replace the drivers by something usable.

Holering 02-16-2014 02:49 AM

Quote:

Originally Posted by mrclisdue (Post 5118186)
When you're connected via nm-applet, and you don't have internet access, what are the outputs of:
# route and # less /etc/resolv.conf ?

How does this change when you issue:

# dhclient


cheers,

After nm-applet successfully connects, /etc/resolv.conf shows
Code:

# Generated by NetworkManager
nameserver 192.168.1.1

route hangs and doesn't continue showing
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface

and I have to force quite or break (ctrl-backslash or ctrl-c).

After running dhclient wlan0, /etc/resolv.conf changes to
Code:

nameserver 192.168.1.1
After dhclient, route also shows
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface
default        192.168.1.1    0.0.0.0        UG    0      0        0 wlan0
default        192.168.1.1    0.0.0.0        UG    0      0        0 wlan0
loopback        *              255.0.0.0      U    0      0        0 lo
192.168.1.0    *              255.255.255.0  U    0      0        0 wlan0
192.168.1.1    *              255.255.255.255 UH    0      0        0 wlan0


kikinovak 02-16-2014 05:26 AM

It's maybe driver related. Just tell us the model of your wireless card (see post above).

guanx 02-16-2014 08:14 AM

Quote:

Originally Posted by Holering (Post 5118537)
...
route hangs and doesn't continue showing
Code:

Kernel IP routing table
Destination    Gateway        Genmask        Flags Metric Ref    Use Iface

and I have to force quite or break (ctrl-backslash or ctrl-c).
...

Does "route -n" show something?

eloi 02-16-2014 08:28 AM

Using:

Code:

nameserver 192.168.1.1
you are relaying in your router. Your router should have obtained before the DNSs from your internet provider. You can check that accessing to your router.

Or try what tronayne suggested you. But before you should add "nohook resolv.conf" to /etc/dhcpcd.conf to avoid dhcpcd to overwrite resolv.conf.

Code:

# echo "nohook resolv.conf" >> /etc/dhcpcd.conf
Using graphical applets you will need help with *the same issue* tomorrow, the next week, the next month and the next year. Learn how to fish is a better strategy ;-). Your choice.

tronayne 02-16-2014 09:04 AM

I always have this sort of problem with a lap top when I'm away from home using it with a wi-fi connection. At home, the lap top is connected to the router with an Ethernet cable and works just wonderfully; away, it's connected with WICD which promptly overwrites /etc/resolv.conf with the wi-fi router's DNS addresses (which do not provide DNS service).

I have fiddled, faddled and fubbled with WICD and have never found a way to prevent this from happening so I just keep a /etc/resolv.bak file and copy it to /etc/resolv.conf whenever I'm remote -- boot the lap top, connect to the wi-fi, run cp /etc/resolv.bak /etc/resolv.conf and I'm good to go.

It's engineering klugemanship to do that, I am well aware, but I've never found another way to make the damned thing work right so I just do that so I can get going and use the blasted lap top to do what I need to. At home it's hard wired with a fixed-IP address and I don't have any problem.

Bottom line: you get connected but routers really don't provide DNS services and you're not going to have Internet service without some sort of DNS (so you don't have to type dotted-quad Internet addresses, http://news.google.com is a whole lot easier than 74.125.224.201 to remember, that's what the Domain Name System -- DNS -- is there for).

I would do what eloi suggests just above here (I'm going to try that myself to see if it fixes the problem and I don't have to kluge it with copying). You will need to stop DHCP and restart it for the change to take effect.

And, put this in your /etc/resolv.conf file:
Code:

search com
nameserver 8.8.8.8
nameserver 8.8.4.4

and see what you get (and make sure it's still there after you restart DHCP).

Hope this helps some.

allend 02-16-2014 09:04 AM

What version of dhcpcd are you trying to use? I have had problems with NetworkManager and dhcpcd-6.0.5. http://www.linuxquestions.org/questi...2/#post5069349

From what I have observed, dhcpcd-6.0.5 first attempts to get an IPv6 address. If that fails, the interface in use is removed, rather than being preserved for an attempt to get an IPv4 address.
I have no problems using dhcpcd-5.6.6.

mrclisdue 02-16-2014 09:07 AM

Well, a guess is that dhclient isn't invoked properly when nm connects, thus a proper route isn't established until you invoke dhclient yourself.

I'm not sure if stopping NetworkManager, then # strace /usr/sbin/NetworkManager will yield any clues ....

You may also consider removing nm and reinstalling; or editing the connection in nm-applet and trying a static, manual setup, though that may not suit your situation.

Yet another option may be using wicd instead, though again this may not suit your situation.

cheers,

mrclisdue 02-16-2014 09:11 AM

Quote:

Originally Posted by tronayne (Post 5118670)
...it's connected with WICD which promptly overwrites /etc/resolv.con with the wi-fi router's DNS addresses (which do not provide DNS service).

I have fiddled, faddled and fubbled with WICD and have never found a way to prevent this from happening so I just keep a /etc/resolv.bak file and copy it to /etc/resolv.conf whenever I'm remote -- boot the lap top, connect to the wi-fi, run cp /etc/resolv.bak /etc/resolv.conf and I'm good to go.

It's engineering klugemanship to do that, I am well aware, but I've never found another way to make the damned thing work right so I just do that so I can get going and use the blasted lap top to do what I need to....

Code:

# chattr +i /etc/resolv.conf
cheers,

kikinovak 02-16-2014 09:21 AM

I know I'm repeating myself (sorry), but a Broadcom wireless card with native drivers instead of broadcom-sta shows exactly this kind of behaviour. Now the OP can encourage further fruitless speculation by NOT posting his chipset.

tronayne 02-16-2014 09:32 AM

Quote:

Originally Posted by mrclisdue (Post 5118674)
Code:

# chattr +i /etc/resolv.conf

That's a great Kludge! :cool:

Doesn't really solve the problem (of /etc/resolv.conf file being overwritten in the first place), but does prevent it from happening.

I've tried, without success, un-commentiing
Code:

DHCP_KEEPRESOLV[4]="yes"      # If you don't want /etc/resolv.conf overwritten
in /etc/rc.d/rc.inet1.conf (and everything else I can find to fiddle with) with no joy here in Snowville (it's about four feet deep outside as of today).

Maybe the chattr thing will work, eh?

Thanks

eloi 02-16-2014 12:20 PM

I mentioned dhcpcd because till I know is what Slackware uses by default. But I don't use NetworkManager, perhaps it calls dhclient instead so changing dhcpcd.conf like I've said above has no efect.

I know in dhclient.conf you can prepend some servers with:

Code:

prepend domain-name-servers 8.8.8.8, 8.8.4.4;


All times are GMT -5. The time now is 07:49 PM.