2

I can connect my Raspberry Pi 4 to my wifi, but I can't seem to access the internet. I can ping machines on the network, and I can ping (and even VNC into) the Pi from network machines. However, I can't access the internet from the Pi. Please help!

I've included some output below that will hopefully help. I'm happy to provide command outputs as needed. I really appreciate any input you can provide!

pi@rasp:~ $ route -n
Kernel IP routing table
Destination   Gateway       Genmask        Flags Metric Ref Use Iface
0.0.0.0       192.168.1.1   0.0.0.0        UG    303    0   0   wlan0
192.168.1.0   0.0.0.0       255.255.255.0  U     303    0   0   wlan0
pi@rasp:~ $ ping google.com
ping: google.com: Name or service not known
pi@rasp:~ $ cat /etc/network/interfaces
# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d
pi@rasp:~ $ cat /etc/resolv.conf
# Generated by resolvconf
domain Home
nameserver 192.168.1.1
pi@raspberrypi:~ $ ifconfig
eth0: flags=4099<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        ether dc:a6:32:38:12:4f  txqueuelen 1000  (Ethernet)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

lo: flags=73<UP,LOOPBACK,RUNNING>  mtu 65536
        inet 127.0.0.1  netmask 255.0.0.0
        inet6 ::1  prefixlen 128  scopeid 0x10<host>
        loop  txqueuelen 1000  (Local Loopback)
        RX packets 2126  bytes 698889 (682.5 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2126  bytes 698889 (682.5 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0

wlan0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST>  mtu 1500
        inet 192.168.1.57  netmask 255.255.255.0  broadcast 192.168.1.255
        inet6 fe80::1b86:80c7:81f7:5cf6  prefixlen 64  scopeid 0x20<link>
        ether dc:a6:32:38:12:50  txqueuelen 1000  (Ethernet)
        RX packets 3689  bytes 838441 (818.7 KiB)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 2013  bytes 299366 (292.3 KiB)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
pi@rasp:~ $ ping 4.2.2.4
PING 4.2.2.24 (4.2.2.4) 56(84) bytes of data.
64 bytes from 4.2.2.4: imp_seq=1 ttl=57 time=29.4 ms
64 bytes from 4.2.2.4: imp_seq=2 ttl=57 time=30.4 ms
64 bytes from 4.2.2.4: imp_seq=3 ttl=57 time=30.4 ms
...
^C
--- 4.2.2.4 ping statistics ---
16 packets transmitted, 16 received, 0% packet loss, time 39ms
rtt min/avg/max/mdev = 27.547/39.744/131.852/25.332 ms
pi@rasp:~ $ cat /etc/dhcpcd.conf 
# A sample configuration for dhcpcd.
# See dhcpcd.conf(5) for details.

# Allow users of this group to interact with dhcpcd via the control socket.
#controlgroup wheel

# Inform the DHCP server of our hostname for DDNS.
hostname

# Use the hardware address of the interface for the Client ID.
clientid
# or
# Use the same DUID + IAID as set in DHCPv6 for DHCPv4 ClientID as per RFC4361.
# Some non-RFC compliant DHCP servers do not reply with this set.
# In this case, comment out duid and enable clientid above.
#duid

# Persist interface configuration when dhcpcd exits.
persistent

# Rapid commit support.
# Safe to enable by default because it requires the equivalent option set
# on the server to actually work.
option rapid_commit

# A list of options to request from the DHCP server.
option domain_name_servers, domain_name, domain_search, host_name
option classless_static_routes
# Respect the network MTU. This is applied to DHCP routes.
option interface_mtu

# Most distributions have NTP support.
#option ntp_servers

# A ServerID is required by RFC2131.
require dhcp_server_identifier

# Generate SLAAC address using the Hardware Address of the interface
#slaac hwaddr
# OR generate Stable Private IPv6 Addresses based from the DUID
slaac private

# Example static IP configuration:
#interface eth0
#static ip_address=192.168.0.10/24
#static ip6_address=fd51:42f8:caae:d92e::ff/64
#static routers=192.168.0.1
#static domain_name_servers=192.168.0.1 8.8.8.8 fd51:42f8:caae:d92e::1

# It is possible to fall back to a static IP if DHCP fails:
# define static profile
#profile static_eth0
#static ip_address=192.168.1.23/24
#static routers=192.168.1.1
#static domain_name_servers=192.168.1.1

# fallback to static profile on eth0
#interface eth0
#fallback static_eth0
13
  • Hello and welcome to this community. || If you ping 4.2.2.4 and it gives you echo reply, comment all lines of /etc/resolv.conf and add nameserver 4.2.2.4, then add the result to the question.
    – M. Rostami
    Jan 24, 2020 at 21:04
  • Alright, after that, try ping www.google.com.
    – M. Rostami
    Jan 24, 2020 at 21:08
  • @M.Rostami Same issue as before ping: www.google.com: Name or service not known
    – im_ashwin
    Jan 24, 2020 at 21:13
  • Ok, so now realized that the name server is not the problem. Additionally, add configuration of this file /etc/dhcpcd.conf to the question. It would help the experts to deduce what's the problem.
    – M. Rostami
    Jan 24, 2020 at 21:16
  • @M.Rostami Added.
    – im_ashwin
    Jan 24, 2020 at 21:20

2 Answers 2

0

After a ton of time spent Google and StackExchange searching, I wasn't able to solve the issue. So I just resorted to wiping and reinstalling the OS from scratch. It works.

1
  • Please mark the answer as the accepted one with a click on the tick on its left side. That prevents your Question from being shown as a unsolved Post to the community and saves them/us a lot of work.
    – Ingo
    Oct 24, 2020 at 21:35
0

Go to the edit connections and go to the wifi and click on the settings icon and got to general and put the priority to -999 which will start the wifi service as soon as the raspberry pi starts.

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.