A collection of bash scripts to configure your Raspberry Pi 5 with various services including workflow automation, AI models, WiFi hotspot, VPN routing, and domain filtering.
| Script | Purpose |
|---|---|
configure_n8n.sh |
n8n + Ollama with Phi-3 AI model |
configure_hotspot.sh |
5GHz WiFi hotspot with VPN routing |
configure_vpn_routing.sh |
VPN routing gateway for hotspot clients |
configure_openclaw.sh |
OpenClaw AI agent with Ollama |
filter_domains.sh |
Block domains via dnsmasq |
Installs and configures n8n (workflow automation platform) with Ollama for local AI capabilities.
- Installs Docker if not present
- Installs and configures Ollama as a systemd service
- Pulls Microsoft Phi-3 AI model
- Runs n8n container with persistent storage
- Optional proxy support for restricted networks
./configure_n8n.sh- n8n URL:
http://<PI_IP>:5678 - Ollama Base URL:
http://host.docker.internal:11434
Creates a 5GHz WiFi hotspot with VPN-based routing and a kill switch to prevent traffic leaks.
- 5GHz access point (Channel 36, SSID:
RouterAX) - DHCP server with dnsmasq (192.168.4.10-100)
- Policy-based routing via
vpntable(tun0) - Kill switch to block non-VPN traffic
- DNS redirection enforcement
- IPTables NAT with persistent rules
./configure_hotspot.shEdit these variables at the top of the script:
SSID="RouterAX" # WiFi network name
PASSPHRASE="test_pass" # WiFi password
COUNTRY="IR" # Regulatory domain
CHANNEL="36" # WiFi channel- WiFi Network: 5GHz, WPA2-PSK
- Hotspot IP: 192.168.4.1
Configures the Raspberry Pi as a VPN gateway for connected hotspot clients. Traffic from the hotspot network (192.168.4.0/24) is routed exclusively through the VPN (tun0).
- IP forwarding configuration
- Custom routing table (
vpn) for policy routing - DNSSEC-compatible dnsmasq configuration
- NAT rules for VPN (tun0) with fallback to ethernet (eth0)
- Kill switch to prevent leaks to eth0
- FORWARD chain rules for VPN traffic
./configure_vpn_routing.sh- OpenVPN must be running with
tun0interface active - Run after
configure_hotspot.sh
- Routes hotspot traffic through
tun0(VPN) - Falls back to
eth0only if VPN is down (optional safety)
Installs OpenClaw (AI agent platform) with Ollama Phi-3 model integration.
- Installs Docker if not present
- Creates
.openclawdirectory with proper permissions - Pulls OpenClaw Docker image
- Configures Ollama as model provider
- Runs OpenClaw container on host network
./configure_openclaw.shEdit these variables at the top of the script:
PROXY_URL="http://192.168.1.94:8118"
OPENCLAW_GATEWAY_TOKEN="test_token_secret"- OpenClaw URL:
http://<PI_IP>:18789 - Gateway Token:
test_token_secret(change in production!)
Interactive script to block domains using dnsmasq.
- Interactive domain input with validation
- Blocks both root domain and
www.variant - Automatic dnsmasq restart
- Local DNS resolution test
- Duplicate detection
./filter_domains.shEnter domain to block (e.g. example.com): ads.example.com
[+] Blocking domain: ads.example.com
[+] Restarting dnsmasq...
[+] Testing resolution locally...
[✔] Domain 'ads.example.com' successfully blocked!
Blocked domains are stored in: /etc/dnsmasq.d/blocked_domains.conf
┌─────────────────────────────────────┐
│ Raspberry Pi 5 │
│ │
┌──────────────┐ │ ┌─────────────┐ ┌─────────────┐ │
│ Ethernet │────│──│ Hotspot │──│ n8n │ │
│ (Internet) │ │ │ (wlan0) │ │ Ollama │ │
└──────────────┘ │ └──────┬──────┘ │ OpenClaw │ │
│ │ └─────────────┘ │
│ │ │
│ Policy Route
│ (vpntable)
│ │
│ ▼
│ ┌─────────────┐
│ │ VPN (tun0) │
│ └─────────────┘
└─────────────────────────────────────┘
▲
│
┌──────┴──────┐
│ Clients │
│ (WiFi) │
└─────────────┘
- Raspberry Pi 5
- Raspberry Pi OS (64-bit)
- WiFi adapter supporting 5GHz (for hotspot)
- Root/sudo access
- Clone or copy scripts to your Pi
- Make scripts executable:
chmod +x *.sh - Run the desired configuration script
- Follow the on-screen instructions
- Some scripts require a restart or manual service start after completion
- VPN scripts require an active VPN connection (
tun0) for full functionality - Change default passwords and tokens before deploying
- Firewall rules persist via
iptables-persistent