Connecting Your Raspberry Pi to the Internet with Ethernet

This guide will show you how to connect your Raspberry Pi to an ethernet network and access the internet. …


Updated September 5, 2023

Need help with your Raspberry Pi?
Contact Me!

Do you love silly Raspberry Pi Projects?
Check out my this YouTube Channel!


This guide will show you how to connect your Raspberry Pi to an ethernet network and access the internet.

Raspberry Pi is a popular single-board computer used for various projects, including home automation, robotics, and IoT devices. One of the most common ways to connect it to the internet is via Ethernet cable. In this article, we’ll show you how to set up your Raspberry Pi to use ethernet for internet access.

Step 1: Prepare Your Materials

To connect your Raspberry Pi to an ethernet network, you will need the following materials:

  • A Raspberry Pi with a running OS (e.g., Raspbian)
  • An Ethernet cable (CAT5 or CAT6)
  • An ethernet port on your router or switch

Step 2: Connect the Cable

Plug one end of the Ethernet cable into the Ethernet port on your Raspberry Pi and the other end into a free port on your router or switch. Make sure both ends of the cable are firmly connected.

Step 3: Configure Network Settings

Next, you need to configure the network settings on your Raspberry Pi so it can communicate with the ethernet network. Open the terminal and type the following commands:

sudo nano /etc/dhcpcd.conf

This will open the dhcpcd configuration file in the nano text editor. Scroll to the bottom of the file and add the following lines:

interface eth0
static ip_address=192.168.1.10/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

These lines set a static IP address, router, and DNS server for the ethernet interface. Replace 192.168.1.10 with an available IP address on your network (e.g., 192.168.1.11, 192.168.1.12, etc.), and make sure to use the correct subnet mask (/24 in this example). Save the changes by pressing Ctrl + X, then Y, and finally Enter.

Step 4: Restart the Network Service

To apply the new network settings, restart the dhcpcd service with the following command:

sudo systemctl restart dhcpcd

Step 5: Test Your Connection

You can now test your ethernet connection by pinging a website or using a web browser to visit one. For example, enter the following command in the terminal:

ping google.com

If you receive responses from Google’s servers, your Raspberry Pi is successfully connected to the internet over ethernet.

That’s it! You have now connected your Raspberry Pi to an ethernet network and can use it for various projects that require internet access.