🐧 2. Raspberry Pi – Linux Environment
Estimated reading: 4 minutes 63 views

πŸ“‘ Raspberry Pi – Networking Basics (Wi-Fi & Ethernet Setup Guide 2025)


🧲 Introduction – Why Networking Matters on Raspberry Pi?

Whether you’re building an IoT project, setting up a web server, or connecting remotely via SSH, networking is the backbone of every Raspberry Pi project. Understanding how to connect your Raspberry Pi to the internet using Wi-Fi or Ethernet is a foundational skill for any Pi user.

🎯 In this guide, you’ll learn:

  • How to connect your Raspberry Pi to Wi-Fi and Ethernet
  • How to set static or dynamic IP addresses
  • Useful commands to diagnose and troubleshoot networking
  • How to enable remote access via SSH or VNC

🌐 Ways to Connect Raspberry Pi to a Network

πŸ”Œ MethodπŸ“˜ Description
Wi-FiWireless connectivity via built-in or USB dongle
EthernetWired connection for stable, fast networking
USB TetheringShare phone’s network using USB (advanced)
Headless SetupPre-configure Wi-Fi before first boot (no monitor)

βœ… Raspberry Pi 3, 4, 400, and 5 models come with built-in Wi-Fi and Ethernet ports.


πŸ“Ά Setting Up Wi-Fi via GUI (PIXEL Desktop)

  1. Boot your Pi with Raspberry Pi OS Desktop
  2. Click the network icon (top-right corner)
  3. Select your Wi-Fi SSID
  4. Enter your Wi-Fi password
  5. You’re connected!

🧠 This is the easiest method for beginners using a monitor and keyboard.


πŸ”§ Setting Up Wi-Fi via Terminal (Headless)

  1. Mount your SD card on another PC
  2. Navigate to the /boot partition
  3. Create a file named wpa_supplicant.conf with the following content:
country=IN
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
network={
    ssid="YourWiFiName"
    psk="YourWiFiPassword"
    key_mgmt=WPA-PSK
}
  1. Also create an empty file named ssh in the same folder to enable SSH
  2. Insert SD card back into Pi and boot

πŸ“‘ The Pi will automatically connect to the Wi-Fi on startup.


πŸ”Œ Ethernet Connection – Just Plug & Go

Plug one end of a LAN cable into your Raspberry Pi’s Ethernet port, and the other into your router or switch. The Pi will automatically get an IP address via DHCP.

βœ… Ethernet is:

  • Faster and more stable
  • Ideal for servers, media centers, and remote desktops

🧭 Finding Your IP Address

Use one of these commands to get your Pi’s IP:

hostname -I

OR

ip a

Example output:

192.168.1.42

You can now SSH or VNC into your Pi using this IP.


🎯 Set a Static IP Address (Wi-Fi or Ethernet)

Edit the dhcpcd configuration:

sudo nano /etc/dhcpcd.conf

Add at the bottom:

interface wlan0
static ip_address=192.168.1.100/24
static routers=192.168.1.1
static domain_name_servers=8.8.8.8

interface eth0
static ip_address=192.168.1.200/24

Then reboot:

sudo reboot

πŸ“Œ This ensures your Pi keeps the same IP after reboot.


πŸ§ͺ Useful Networking Commands

πŸ”§ CommandπŸ“ Function
ping google.comTest internet connection
ifconfig / ip aShow network interfaces and IPs
iwconfigView wireless configuration
netstat -tulnView open ports and services
traceroute <host>Track network path to a host
nmcli dev wifi listList nearby Wi-Fi networks (if using NM)

πŸ” Remote Access over Network (SSH & VNC)

βœ… Enable SSH

sudo raspi-config β†’ Interface Options β†’ SSH β†’ Enable

OR place an empty file named ssh in the /boot partition (for headless setup).

Then connect from another PC:

ssh pi@<ip-address>

βœ… Enable VNC (Remote Desktop GUI)

sudo raspi-config β†’ Interface Options β†’ VNC β†’ Enable

Use RealVNC Viewer on another device to connect.


πŸ“Œ Summary – Recap & Next Steps

Getting your Raspberry Pi online is the first step toward headless setups, IoT, remote control, and much more. With a stable Wi-Fi or Ethernet connection, you can manage your Pi from anywhere.

πŸ” Key takeaways:

  • Use GUI or terminal methods to connect to Wi-Fi
  • Ethernet offers faster and more stable connections
  • Use hostname -I, ip a, or ifconfig to find IPs
  • Set static IPs by editing /etc/dhcpcd.conf
  • Enable SSH and VNC for remote network access

βš™οΈ Real-world relevance: Essential for remote access, web servers, networked sensors, and media streaming via Raspberry Pi.


❓ FAQs – Raspberry Pi Networking

❓ How do I connect Raspberry Pi to Wi-Fi without monitor?

βœ… Add a wpa_supplicant.conf file and an empty ssh file to the /boot partition of your SD card before first boot.


❓ How do I find the IP address of my Raspberry Pi?

βœ… Use:

hostname -I

Or check connected devices on your router’s admin page.


❓ Can I use both Wi-Fi and Ethernet simultaneously?

βœ… Yes, but by default Ethernet has higher priority. You can manually assign routes for custom setups.


❓ Is static IP better for Raspberry Pi?

βœ… Yesβ€”for projects needing remote access or port forwarding (e.g., web server, SSH, VNC).


❓ How do I troubleshoot Raspberry Pi internet issues?

βœ… Try:

ping google.com

If it fails, check ifconfig, router, or wpa_supplicant.conf errors.


Share Now :

Leave a Reply

Your email address will not be published. Required fields are marked *

Share

πŸ“‘ Raspberry Pi – Networking Basics (Wi-Fi, Ethernet)

Or Copy Link

CONTENTS
Scroll to Top