brandon93s
Posts: 3
Joined: Sat Jan 26, 2013 9:27 pm

WIFI connects, no internet access.

Sat Jan 26, 2013 9:34 pm

I am trying to configure an edimax EW-7811Un, and I have gotten it to connect to my network. I can SSH into it over wifi, as well as access terminal from my PC. However, the Pi has no internet connectivity. Any ideas why it may be connecting to my wifi but not getting connected to the internet?

I can successfully scan for networks, and all in-rang networks appear. In addition, iwconfig shows wlan0 present, and after turning on my adapter (after boot) using sudo ifup wlan0, I can even see that it is connected to the wifi via the pi. Furthermore, I can see its connectivity via my router.

All configuration has been done over SSH via a wire connection. Running Raspbmc RC3.

Thanks for any help! New pi owner :D

brandon93s
Posts: 3
Joined: Sat Jan 26, 2013 9:27 pm

Re: WIFI connects, no internet access.

Sun Jan 27, 2013 5:43 pm

It seems like it may be a DNS issue, since all of my other wireless devices are running fine over wireless. Is there a way to flush my DNS cache, or renew it? Should I install nscd with:

Code: Select all

sudo apt-get nscd
and then attempt to restart with:

Code: Select all

sudo /etc/init.d/nscd restart
--
I am a total linux newbie, so am not too sure what I am doing! :?
--
In addition, how can I get sudo ifup wlan0 to run on boot so that it will automatically connect to wifi, without me having to ssh into my device via a wired connection (running xbmc). I guess you can also exit xbmc from within raspbmc and access the terminal this way of the host machine.
--
Thanks for any assistance!

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: WIFI connects, no internet access.

Mon Jan 28, 2013 2:54 pm

http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

Mobius
Posts: 238
Joined: Thu Aug 30, 2012 1:07 am
Location: San Angelo, Texas USA

Re: WIFI connects, no internet access.

Mon Jan 28, 2013 3:28 pm

Does your /etc/network/interfaces file have "auto wlan0"? I'm using the same wireless adapter and having no problems with it automatically coming up. If you can SSH into the Pi then I'm not sure why you can't connect to the internet. How are you trying to connect? Are you doing so from the desktop using something like Midori or Netsurf? That's how I do it. All of this assumes that you are using a relatively recent version of Raspbian (October or later).

-rst-
Posts: 1316
Joined: Thu Nov 01, 2012 12:12 pm
Location: Dublin, Ireland

Re: WIFI connects, no internet access.

Mon Jan 28, 2013 4:50 pm

One thing to check after you are sure the local network is up would be to traceroute to see where the internet connections stops - ssh into the RPi and issue this command from the command-line:

Code: Select all

traceroute www.raspberrypi.org
or to check if it is the DNS that fails

Code: Select all

traceroute 93.93.128.176
http://raspberrycompote.blogspot.com/ - Low-level graphics and 'Coding Gold Dust'

efflandt
Posts: 359
Joined: Mon Dec 03, 2012 2:47 am
Location: Elgin, IL USA

Re: WIFI connects, no internet access.

Mon Jan 28, 2013 7:03 pm

If your Pi gets an IP and everything automatically from your router, and anything else connected to that side of the router can access the internet, it should just work, unless your router is set to limit by MAC address and the MAC of the Pi is not listed in the router.

If you manually set IP address, you also need to set gateway (to LAN IP of your router) and add nameserver(s) to /etc/resolv.conf (see man 5 resolver in a terminal).

route -n should show a default gateway (with UG flags) to your router LAN IP and an automatic local route for your LAN.

cat /etc/resolv.conf should show 1 or more nameservers and possibly a domain and/or search domain.

hairyback
Posts: 1
Joined: Fri Feb 22, 2013 1:31 pm

Re: WIFI connects, no internet access.

Fri Feb 22, 2013 1:42 pm

I too have been struggling with internet access over wifi. Getting the Edimax EW-7811 adapter to work was simple enough but I totally omitted the GATEWAY= element of the wlan0 interface.

After days of trawling through the internet researching what I did wrong I came across efflandt's text above and I am now fixed.

The contents of my /etc/network.d/wlan0 file are:

CONNECTION='wireless'
DESCRIPTION='WiFi'
INTERFACE='wlan0'
SECURITY='wpa-config'
WPA_CONF='/etc/wpa_supplicant.conf'
IP='static'
ADDR='10.10.10.5'
GATEWAY='10.10.10.1'
DNS='10.10.10.1'
WPA_DRIVER='wext'
NETCFG_DEBUG=yes

I hope this helps anyone else out there with a similar problem.

[I am using Arch on a headless Pi, setting up a webcam utilising motion and samba to access the recording over my LAN. I am now looking to gain access to my webcam from the WAN. More work to do]

bhuddleston
Posts: 1
Joined: Sat Mar 16, 2013 8:02 am

Re: WIFI connects, no internet access.

Sat Mar 16, 2013 8:21 am

I had exactly this problem. Specifically.
  • The wifi dongle lit up properly
  • I got an IP address from the DHCP server
  • I was able to access devices on the local network
  • I was not able to access the internet
The first thing I noticed when diagnosing this problem is that when I ran /sbin/route I had no default route only the broadcast route. Things don't quite work the way you might expect here. I had originally configured the Pi using an ethernet cable. I then unplugged that cable once I had the Wifi up and going. The default route (which is what gets you off your local network and off to the wilds of the internet) was associated with eth0 and was removed when the cable was unplugged. The wlan0 device did not have a default route presumably because it didn't need one.

That being the case I decided to reboot it to see if it would get the proper default route in the absence of being physically plugged into the network. It did.

Hopefully this will save someone some angst.

Thanks,
Brian

User avatar
swhite58
Posts: 1
Joined: Fri May 17, 2013 6:32 am
Location: Perth, Western Australia

Re: WIFI connects, no internet access.

Fri May 17, 2013 6:42 am

:D
Yes, your suggestion and explanation also worked for me. After hours of fiddling, the simplest answer always does it.

fiatjaf
Posts: 1
Joined: Thu Sep 05, 2013 4:11 pm

Re: WIFI connects, no internet access.

Thu Sep 05, 2013 10:16 pm

If you're connecting que Pi to a lan with a Mikrotik router and MAC/IP binding and HCP Server, you must be sure that:

- Pi is not taking a IP used by other computer, binded to other address;
- the MAC address in the ARP entry for the Pi is the real Pi MAC address (the one displayed at the DHCP leases table), sometimes it just uses a strange MAC (which I don't know from where does it come) at the ARP table and then nothing works.

Hope this helps someone in this specific situation.

User avatar
pluggy
Posts: 3635
Joined: Thu May 31, 2012 3:52 pm
Location: Barnoldswick, Lancashire,UK
Contact: Website

Re: WIFI connects, no internet access.

Fri Sep 06, 2013 4:47 am

The easy to see if its a DNS fault is to

Code: Select all

ping 8.8.8.8
If it returns a ping then the internet is working so then you ping something with a name (that you know returns pings) and if that doesn't work when the 8.8.8.8 does then its a DNS issue.
Don't judge Linux by the Pi.......
I must not tread on too many sacred cows......

baron11
Posts: 1
Joined: Wed Oct 16, 2013 4:21 pm

Re: WIFI connects, no internet access.

Wed Oct 16, 2013 4:28 pm

Hi, I would like to share my experience on this matter too.

It happens to me when I switch from 1 network to another, from static to dhcp then back to static. I was too lazy to plug my Pi into a LAN to get nscd to flush my dns. (I did not try whether does this help. It should.)

Then, I saw a post above stating about /etc/resolv.conf. So I just changed the line to my router's IP and it works immediately.
For example,

Code: Select all

nameserver 192.168.43.1
to

Code: Select all

nameserver 192.168.1.1
(my router's ip in this case)

Hope this helps. ;)

alkopop79
Posts: 53
Joined: Thu Mar 08, 2012 7:10 pm
Location: London

Re: WIFI connects, no internet access.

Mon Sep 29, 2014 7:35 am

baron11 wrote:Hi, I would like to share my experience on this matter too.

It happens to me when I switch from 1 network to another, from static to dhcp then back to static. I was too lazy to plug my Pi into a LAN to get nscd to flush my dns. (I did not try whether does this help. It should.)

Then, I saw a post above stating about /etc/resolv.conf. So I just changed the line to my router's IP and it works immediately.
For example,

Code: Select all

nameserver 192.168.43.1
to

Code: Select all

nameserver 192.168.1.1
(my router's ip in this case)

Hope this helps. ;)

It helped!!! I checked the gateway address with

Code: Select all

netstat -r | grep default
then

Code: Select all

sudo nano /etc/resolv.conf
and replaced the first 'nameserver' address with the gateway IP. Thank you very much!

amitnjha
Posts: 4
Joined: Sat Nov 29, 2014 7:13 am

Re: WIFI connects, no internet access.

Sat Nov 29, 2014 8:09 am

bhuddleston wrote:I had exactly this problem. Specifically.
  • The wifi dongle lit up properly
  • I got an IP address from the DHCP server
  • I was able to access devices on the local network
  • I was not able to access the internet
The first thing I noticed when diagnosing this problem is that when I ran /sbin/route I had no default route only the broadcast route. Things don't quite work the way you might expect here. I had originally configured the Pi using an ethernet cable. I then unplugged that cable once I had the Wifi up and going. The default route (which is what gets you off your local network and off to the wilds of the internet) was associated with eth0 and was removed when the cable was unplugged. The wlan0 device did not have a default route presumably because it didn't need one.

That being the case I decided to reboot it to see if it would get the proper default route in the absence of being physically plugged into the network. It did.

Hopefully this will save someone some angst.

Thanks,
Brian
Thanks for Sharing Brian.
The reboot solved it for me as well.

geotheory
Posts: 20
Joined: Sat Aug 31, 2013 12:22 pm

Re: WIFI connects, no internet access.

Sat Nov 29, 2014 7:07 pm

baron11 wrote:...about /etc/resolv.conf. So I just changed the line to my router's IP and...
Worked for me too. I suspect this is the sticking point for most people trying to setup wifi this way using a fresh wheezy installation. Thanks for sharing :)

mahem
Posts: 2
Joined: Thu Mar 17, 2016 5:31 am

Re: WIFI connects, no internet access.

Thu Jun 30, 2016 9:36 am

Thanks for the detailed info.

Return to “Beginners”