My First Tiny Network
Welcome to our comprehensive guide for setting up your first tiny network, designed specifically for self-hosted environments and homelabs. This tutorial wil....
My First Tiny Network: Setting Up a Home Lab with Raspberry Pi, Firewalla Purple, and POE Switch
Welcome to our comprehensive guide for setting up your first tiny network, designed specifically for self-hosted environments and homelabs. This tutorial will walk you through the installation, configuration, and usage of a network that includes a Raspberry Pi 4B as a locally hosted website, Firewalla Purple as the gateway, and a POE managed switch.
Introduction
The challenge here is to create a functional, secure, and scalable mini-network for self-hosting services and websites. This network setup is perfect for those who want to learn network configuration, routing, and connectivity on a small scale. By the end of this guide, you’ll have a solid understanding of how to set up and maintain your very own tiny network.
Prerequisites
- Hardware: Raspberry Pi 4B (4GB RAM), Firewalla Purple, POE managed switch
- Software: Raspberry Pi OS Lite (v32.x), Firewalla OS (latest stable version)
- Network Requirements: Dynamic IP or Static IP with a valid DNS entry
- Firewall Considerations: Allow traffic on necessary ports (HTTP, HTTPS, SSH, etc.)
- User Permissions: Access to SSH and terminal commands (root/sudo)
Installation & Setup
Raspberry Pi 4B
- Download Raspberry Pi OS Lite:
wget https://downloads.raspberrypi.org/raspbian_lite_latest
- Flash the image to an SD card using a tool like balenaEtcher
- Insert the SD card into the Raspberry Pi, connect to a monitor and power it on
- Configure SSH access:
ssh pi@raspberrypi.local
(default password:raspberry
) - Update the system:
sudo apt-get update && sudo apt-get upgrade -y
- Install Apache2 for web hosting:
sudo apt-get install apache2 -y
- Start and enable Apache2:
systemctl start apache2; systemctl enable apache2
- Verify the installation by opening a browser and navigating to the Raspberry Pi’s IP address (e.g., http://192.168.x.y)
Firewalla Purple
- Follow the Firewalla Purple setup instructions to configure your device, and ensure it has a working internet connection.
- Once connected, you can access the Firewalla dashboard by navigating to
http://firewalla
in your browser or by using the Firewalla app on your smartphone.
POE Switch
- Connect all devices (Raspberry Pi and Firewalla) to the POE switch ports.
- Power up the switch and ensure all connected devices are functioning properly.
Configuration
Configure your Raspberry Pi’s network settings in /etc/dhcpcd.conf
:
1
2
3
4
interface eth0
static ip_address=192.168.x.y/24
static routers=192.168.x.z
static domain_name_servers=8.8.8.8 8.8.4.4
Replace x
, y
, and z
with appropriate values for your network. Save and exit the file, then reboot the Raspberry Pi:
1
sudo reboot
Usage & Operations
- Common Operations: Monitoring, updating packages, and managing web content on the Raspberry Pi
- Monitoring: Use tools like
top
,df -h
, and the Firewalla dashboard to monitor resource usage and network traffic. - Backup and Recovery: Regularly backup critical data (e.g., website files) using tools like rsync or Duplicity
- Scaling Considerations: If more resources are needed, consider upgrading to a more powerful Raspberry Pi model or using multiple devices for load balancing and redundancy.
Troubleshooting
- Common Issues: Network connectivity problems, Apache2 errors, Firewalla malfunctions
- Debug Commands:
journalctl -u apache2
,tcpdump
,ifconfig
- Log Analysis: Review logs in
/var/log/syslog
and/var/log/apache2/*
Conclusion
By following this guide, you’ve now successfully set up your first tiny network. This foundation will serve as a stepping stone for exploring more complex networking configurations in the future. For further learning, check out resources like the Raspberry Pi documentation and Firewalla’s user manual. Happy exploring!