Pi-hole Part 2 - Configure and Secure Ubuntu on Raspberry Pi

Operating System Configuration

  1. Update the operating system and enable automatic security updates
    user@pihole:~ sudo apt update && sudo apt upgrade -y
    user@pihole:~ sudo apt install unattended-upgrades -y
    user@pihole:~ sudo dpkg-reconfigure -plow unattended-upgrades
    
  2. Ensure firewall is installed, configured, and working
    user@pihole:~ sudo apt install ufw -y
    user@pihole:~ sudo ufw allow from 10.0.0.0/8 to any port 22 proto tcp
    user@pihole:~ sudo ufw allow from 192.168.0.0/16 to any port 22 proto tcp
    user@pihole:~ sudo ufw allow from 10.0.0.0/8 to any port 80 proto tcp
    user@pihole:~ sudo ufw allow from 192.168.0.0/16 to any port 80 proto tcp
    user@pihole:~ sudo ufw allow from 10.0.0.0/8 to any port 443 proto tcp
    user@pihole:~ sudo ufw allow from 192.168.0.0/16 to any port 443 proto tcp
    user@pihole:~ sudo ufw allow from 10.0.0.0/8 to any port 53 proto tcp
    user@pihole:~ sudo ufw allow from 192.168.0.0/16 to any port 53 proto tcp
    user@pihole:~ sudo ufw allow from 10.0.0.0/8 to any port 53 proto udp
    user@pihole:~ sudo ufw allow from 192.168.0.0/16 to any port 53 proto udp
    user@pihole:~ sudo ufw allow from 127.0.0.0/8 to any port 4711 proto tcp
    user@pihole:~ sudo systemctl enable ufw
    user@pihole:~ sudo systemctl start ufw
    user@pihole:~ sudo ufw status numbered