0

I am able to connect my RaspberryPi to my android phones hotspot. The Raspberry Pi connects to the network successfully but does not have any access to the internet.

Is there something else I need to do to allow internet access for my Raspberry Pi?

UPDATE

After running ip addr && ip route. There response was:

pi@raspberrypi:~ $ ip addr

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1000
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host
       valid_lft forever preferred_lft forever
2: eth0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc pfifo_fast state DOWN group default qlen 1000
    link/ether b8:27:eb:9d:46:f3 brd ff:ff:ff:ff:ff:ff
3: wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP group default qlen 1000
    link/ether 08:6a:0a:64:16:91 brd ff:ff:ff:ff:ff:ff
    inet 192.168.43.10/24 brd 192.168.43.255 scope global wlan0
       valid_lft forever preferred_lft forever
    inet6 fe80::5cd8:3591:b14a:e9da/64 scope link
       valid_lft forever preferred_lft forever
4: docker0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc noqueue state DOWN group default
    link/ether 02:42:d7:1c:c7:fa brd ff:ff:ff:ff:ff:ff
    inet 172.17.0.1/16 brd 172.17.255.255 scope global docker0
       valid_lft forever preferred_lft forever

pi@raspberrypi:~ $ ip route

default via 192.168.0.1 dev wlan0 src 192.168.43.10 metric 303
172.17.0.0/16 dev docker0 proto kernel scope link src 172.17.0.1 linkdown
192.168.0.1 dev wlan0 proto kernel scope link src 192.168.43.10 metric 303
192.168.43.0/24 dev wlan0 proto kernel scope link src 192.168.43.10 metric 303

Forgot to mention, I have a static IP set to 192.168.43.10 so that I can connect through SSH easily.

  • Normally not. Did you test your mobile hotspot with a different computer? Did it have Internet access? – Dmitry Grigoryev Apr 3 at 13:37
  • When you are connected to the android phone with the RasPi by WiFi then please execute this commands: ip addr and ip route. Please edit your question and paste the output to it. Please address me with @Ingo, otherwise I won't see your reply. – Ingo Apr 3 at 13:49
  • @Ingo I have added the response from those commands – Dave Apr 3 at 14:22
  • @Dmitry Grigoryev Internet connectivity works on other devices e.g Laptop – Dave Apr 3 at 14:23
0

There are something mixed up with your network setting. ip route shows the default route is set to

default via 192.168.0.1 dev wlan0 src 192.168.43.10 metric 303

This is used where to send ip packets that destination address are unknown for the kernel. It is mainly true for packets send to the internet. It will send them to the next gateway, here 192.168.0.1. But your default route isn't valid. The wlan0 interface belongs to network 192.168.43.0/24 (you can see it from ip addr). The gateway must reside on the same subnet than the interface wlan0. The subnet contains usable ip addresses 192.168.43.1 to 192.168.43.254. Now you can see that the gateway isn't member of the subnet. This cannot work. A valid default route entry should look like this:

default via 192.168.43.1 dev wlan0 src 192.168.43.10 metric 303

With the information you provided so far I cannot see what's wrong with your setup. You can try to correct the default route manual with:

rpi ~$ sudo ip route add default via AAA.BBB.CCC.DDD dev wlan0 src WWW.XXX.YYY.ZZZ metric 200

The gateway ip address AAA.BBB.CCC.DDD you will find from the connection with your laptop. Look what gateway in its default route it uses. The interface ip address WWW.XXX.YYY.ZZZ you will find with:

rp ~$ ip -4 -br addr show dev wlan0

You can delete the manual default route with:

rpi ~$ sudo ip route del default via AAA.BBB.CCC.DDD dev wlan0 src WWW.XXX.YYY.ZZZ metric 200
  • 1
    That has helped. Thank you for your time. I also had to go into the /etc/dhcpcd.conf file and change the static router to the same address as the default. Everything is working fine now. – Dave Apr 4 at 9:55

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.