I set the IP of the PI to static (following these guidelines How do I set up networking/WiFi/static IP address on Raspbian/Raspberry Pi OS?) to be able to access it from multiple phones used with tethering.
Specifically I used the dhcpcd method
Editing the /etc/dhcpcd.conf as follows:-
Here is an example which configures a static address, routes and dns.
interface wlan0
static ip_address=192.168.43.12/24
static routers=192.168.43.6
static domain_name_servers=192.168.43.6
The addresses were found using
ip -4 addr show | grep global
ip route | grep default | awk '{print $3}'
cat /etc/resolv.conf
This worked wonderfully as I can connect by VNC without problems but since then I cannot access the internet.
I found several post about this problem but I cannot apply any fix to my specific case.
ping 8.8.8.8 returns:
PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.
From 192.168.43.12 icmp_seq=1 Destination Host Unreachable
From 192.168.43.12 icmp_seq=2 Destination Host Unreachable
and it would continue endlessly the sequence
ping google.com returns:
ping: google.com: Temporary failure in name resolution
For ip route:
default via 192.168.43.6 dev wlan0 src 192.168.43.12 metric 303
192.168.43.0/24 dev wlan0 proto dhcp scope link src 192.168.43.12 metric 303
For sudo ping -c3 $(ip route | awk '/default/ {print $3}')
PING 192.168.43.6 (192.168.43.6) 56(84) bytes of data.
From 192.168.43.12 icmp_seq=1 Destination Host Unreachable
From 192.168.43.12 icmp_seq=2 Destination Host Unreachable
From 192.168.43.12 icmp_seq=3 Destination Host Unreachable
--- 192.168.43.6 ping statistics ---
3 packets transmitted, 0 received, +3 errors, 100% packet loss, time 82ms
pipe 3
For cat /etc/resolv.conf
# Generated by resolvconf nameserver 192.168.43.6 nameserver 8.8.8.8
Is anybody able to help me? And to explain me why it was not working/what I did wrong?
Thank you very much in any case.