Troubleshooting your Raspberry Pi’s internet connectivity can be a daunting task, but with these simple steps you can easily check and diagnose the problem.
This article will guide you through several methods to verify if your Raspberry Pi has a working internet connection. We will cover both wired and wireless connections, and discuss common issues that …
Updated September 28, 2023
This article will guide you through several methods to verify if your Raspberry Pi has a working internet connection. We will cover both wired and wireless connections, and discuss common issues that may arise.
- Checking the network status using
ifconfig
in the terminal:
- Open a terminal window by clicking on the terminal icon in the menu bar or pressing
Ctrl + Alt + T
. - Type
ifconfig
and press Enter. The command will display all the available network interfaces and their current settings, including IP addresses, MAC addresses, and more. - Look for an interface with an IP address that starts with “192.168” or “10.” These are private IP addresses typically assigned by routers to devices on a local network. If you see one, your Raspberry Pi is connected to the internet.
$ ifconfig
eth0: flags=4163<UP,BROADCAST,RUNNING,MULTICAST> mtu 1500
inet 192.168.1.10 netmask 255.255.255.0 broadcast 192.168.1.255
ether b8:xx:xx:xx:xx:xx:xx txqueuelen 10000 (Ethernet)
RX packets 43761 bytes 3564097 (348.1 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 2879 bytes 437078 (426.9 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
lo: flags=73<UP,LOOPBACK,RUNNING> mtu 655360
inet 127.0.0.1 netmask 255.0.0.0
loop txqueuelen 1000 (Local Loopback)
RX packets 489 bytes 39248 (38.3 KiB)
RX errors 0 dropped 0 overruns 0 frame 0
TX packets 489 bytes 39248 (38.3 KiB)
TX errors 0 dropped 0 overruns 0 carrier 0 collisions 0
- Checking the network status using
nmcli
in the terminal:
- Open a terminal window and type
nmcli d
and press Enter. This command will display information about your network devices, including their state (connected or disconnected) and connection names (if applicable). - Look for an active connection with “Wired” or “Wireless” in the DEVICE column. If you see one, your Raspberry Pi is connected to the internet.
$ nmcli d
DEVICE TYPE STATE CONNECTION
eth0 ethernet connected Wired connection 1
wlan0 wifi disconnected --
lo loopback unmanaged --
- Checking the network status using the Network Manager applet:
- If you’re running Raspbian with a desktop environment, you can use the Network Manager applet in the top right corner of the screen to see the current network status.
- Click on the applet and look for an active connection under “Wired” or “Wireless.” If you see one, your Raspberry Pi is connected to the internet.
Common Issues:
- No IP address: If your interface does not have an IP address, it’s possible that your router has not assigned one yet or the DHCP server is not working correctly. Try restarting the router and checking again later.
- DNS issues: If you can ping IP addresses but not domain names (e.g.,
ping 8.8.8.8.8
works butping google.com
doesn’t), it could be a DNS issue. Edit your/etc/resolv.conf
file and add the following line at the top:
nameserver 8.8.8.8.8
This will use Google’s public DNS server to resolve domain names. Save the changes and try again.
- WiFi not connecting: If your Raspberry Pi is having trouble connecting to a WiFi network, make sure you have the correct SSID and password in your
/etc/wpa_supplicant/wpa_supplicant.conf
file. You can also try runningsudo wpa_cli reconfigure
to apply changes without restarting. - Ethernet not connecting: If your Raspberry Pi is connected via Ethernet but still not getting an IP address, check the cable and ensure it’s plugged in securely. You can also try restarting the network service with
sudo systemctl restart networking
.