I’m going to write a series of posts about Raspberry Pi and how I use it to secure and optimize my home network. This first post covers the basic setup procedure. Please refer to the official setup guide if you need the step-by-step instruction.
Hardware
- Raspberry Pi 3 Model B. At the time of writing, the latest board is Raspberry Pi 4 Mode B, which is more powerful. But any version Raspberry Pi board should work.
- MicroSD card (minimum 4GB)
- Micro USB power supply (2.5A). For Raspberry Pi 4, you need the USB-C power supply
- USB keyboard and mouse
- Full-size HDMI cable to connect Raspberry Pi to a monitor or TV duing the initial setup. For Raspberry Pi 4, you need the Micro HDMI cable
- Raspberry Pi case
Operating system
- Raspbian - the offical Raspberry Pi operating system. I want to keep the OS footprint small and I don’t plan to connect to a monitor other than the initial setup, so I select Raspbian Lite image.
Basic procedure
- Download Raspbian Lite image
- Download balenaEtcher
- Launch balenaEtcher and write the Raspbian image to the SD card
- Insert the SD card, connect the network cable, the keyboard & mouse, monitor and power supply to the board
- Power on and walk through the setup
- At the console prompt, log in with the default credential: pi / raspberry
- passwd
- change the user pi’s password
- sudo raspi-config
- configure time zone, locale and keyboard layout
- enable SSH under Interfacing options
- sudo nano /etc/dhcpcd.conf
- configure a static IP address on eth0
- interface eth0
static ip_address=x.x.x.x/24
static routers=x.x.x.x
static domain_name_servers=x.x.x.x
- sudo nano /etc/sysctl.conf
- disable IPv6, by adding a line “net.ipv6.conf.all.disable_ipv6 = 1"
- sudo sysctl -p
- sudo apt update && sudo apt upgrade -y
- sudo reboot
- after reboot, verify SSH login
Now the Raspberry Pi is fully functional. I’m going to use it to set up Pi-Hole to block Ad, DNS-Over-HTTPS (DoH) for privacy, CUPS to add AirPrint to an USB printer, and more. Stay tuned.