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     U     201    0        0 lo   U     303    0        0 wlan0

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

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.


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
    Commented Feb 13, 2017 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
    Commented Feb 13, 2017 at 10:15
  • @Deleuze Unfortunately I have no ethernet cable. Commented Feb 13, 2017 at 10:26
  • @Milliways I have used the Rpi Wifi settings Manger to do it . Commented Feb 13, 2017 at 10:27

2 Answers 2


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

  • 1
    This worked for me too.
    – user72982
    Commented Dec 14, 2017 at 9:31
  • I cannot get this answer to work with Raspbian Stretch. Results in the RPi3 wifi to remain non-functioning. Commented Oct 4, 2018 at 14:03
  • This is the most direct & best answer and worked for me. Thanks for the quick fix.
    – raddevus
    Commented Mar 24, 2022 at 14:59

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

allow-hotplug wlan0
iface wlan0 inet manual


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 and acknowledge you have read our privacy policy.

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