3

My problem is that, after connecting my Rpi to the home Wifi network, it refuses to connect to the internet. Funny thing is: I am connected to it via ssh. I tried to ping google, but it said:

connect: Network is unreachable

Then I tried to ping google`s IP, but the same thing happened. I tried the method described here but nothing is working. How can I get my pi to connect to the internet?

If this might be any help, here is the output of route -n:

Kernel IP routing table
Destination     Gateway         Genmask         Flags Metric Ref    Use Iface
169.254.0.0     0.0.0.0         255.255.0.0     U     201    0        0 lo
192.168.1.0     0.0.0.0         255.255.255.0   U     303    0        0 wlan0

I had my pi connected to this network before and I have set it to a static IP "192.168.1.23". It used to work but it suddenly broke and hostname -I gives the following output:

192.168.1.23

So everything seems to be correct aside from the fact that I cannot reach everything (literally everything, even localhost is unreachable). And one more thing: I am connected to WiFi via a repeater. Thanks in advance.

PS: My question is not a duplicate of this question. I have searched pi StackExchange but nothing worked.

EDIT:

I used the WiFi management GUI To set the static IP on my Pi.

  • Would you be able to confirm whether you can access the internet when connected through ethernet? – Deleuze Feb 13 '17 at 10:06
  • 1
    "I have set it to a static IP" but have NOT said how, and the evidence of IP routing table is otherwise. See How do I set up networking/WiFi/Static IP – Milliways Feb 13 '17 at 10:15
  • @Deleuze Unfortunately I have no ethernet cable. – mohamed emad Feb 13 '17 at 10:26
  • @Milliways I have used the Rpi Wifi settings Manger to do it . – mohamed emad Feb 13 '17 at 10:27
1

Thanks Guys But I found the answer Everything worked after I reset the configuration in my /etc/network/interfaces to

auto lo

iface lo inet loopback
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp

,thanks anyway

  • This worked for me too. – hat Dec 14 '17 at 9:31
  • I cannot get this answer to work with Raspbian Stretch. Results in the RPi3 wifi to remain non-functioning. – bobthechemist Oct 4 '18 at 14:03
-1

I had the same problem using Wi-Fi, I had also to change:

allow-hotplug wlan0
iface wlan0 inet manual

to:

allow-hotplug wlan0
iface wlan0 inet dhcp

Then the internet connection worked

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.