Post

My Wife Asked For A Simple Box To Hide The Wifi Gear I Gave Her The Droid She Wasnt Looking For

In this guide, we will walk you through building a custom network enclosure to hide your WiFi gear. This project is particularly relevant for homelab enthusi....

# My Wife Asked For A Simple Box To Hide The WiFi Gear I Gave Her The Droid She Wasn’t Looking For: Building a Custom Network Enclosure for Your Homelab

In this guide, we will walk you through building a custom network enclosure to hide your WiFi gear. This project is particularly relevant for homelab enthusiasts and self-hosted environments who wish to maintain a clean and organized setup while keeping their equipment safe from curious hands.

Prerequisites

  • Operating System: Ubuntu Server 20.04 LTS or higher (versions may vary depending on the enclosure’s hardware)
  • Hardware: Adequate specifications for the components you wish to house in the enclosure, such as a Raspberry Pi or similar Single Board Computer (SBC), network switches, WiFi access points, and power supply.
  • Software: Docker 20.10.x or higher, containerd 1.4.x or higher, and Kubernetes 1.23.x or higher (optional)
  • Network Requirements: Stable internet connection with a static IP address (if applicable), suitable Ethernet ports for all components, and necessary firewall rules configured to allow traffic as required.
  • User Permissions: Ensure you have root access or the appropriate sudo privileges for performing system-level tasks.

Installation & Setup

  1. Install Docker: Run the following command to install Docker on your host machine:
    1
    
    sudo apt-get update && sudo apt-get install docker.io -y
    
  2. Enable and Start Docker: Start the Docker service and ensure it starts automatically at boot:
    1
    
    sudo systemctl enable docker && sudo systemctl start docker
    
  3. Install Kubernetes (optional): Follow the official Kubernetes installation guide to install and configure Kubernetes on your host machine if desired.

Configuration

  1. Create a Network Enclosure Dockerfile: In a new directory, create a Dockerfile with the following content:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    
    # Base image
    FROM alpine:latest
    
    # Install necessary tools
    RUN apk add --no-cache nginx
    
    # Expose port 80 for access to web interface (optional)
    EXPOSE 80
    
    # Set working directory
    WORKDIR /var/www/html
    
    # Copy the configuration files
    COPY nginx.conf /etc/nginx/nginx.conf
    COPY default.conf /usr/share/nginx/html/default.conf
    
    # Start the nginx service at container startup
    CMD ["nginx", "-g", "daemon off;"]
    
  2. Create an nginx configuration file (nginx.conf): Define your network enclosure web interface settings in this file, including IP addresses, hostnames, and any necessary server blocks:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    
    worker_processes 1;
    
    events { worker_connections 768; }
    
    http {
        server {
            listen 80 default_server;
            server_name your_network_enclosure_ip_address;
    
            location / {
                root /usr/share/nginx/html;
                index default.conf;
            }
    
            # Optional: Redirect to a custom web interface if desired
            location /webui/ {
                rewrite ^/webui/(.*)$ /$1 last;
                proxy_pass http://localhost:8080;
            }
        }
    }
    
  3. Create the default configuration file (default.conf): This file will contain the actual network enclosure UI, which can be customized to your liking using HTML, CSS, and JavaScript.
  4. Build the Docker image: Run the following command to build the Docker image:
    1
    
    docker build -t network-enclosure .
    
  5. Run the container: Start the network enclosure container in detached mode:
    1
    
    docker run --name network-enclosure -d -p 80:80 network-enclosure
    
  6. Access the web interface (optional): If you have exposed port 80 and defined a server block for your IP address in the nginx configuration file, access the network enclosure UI by navigating to http://your_network_enclosure_ip_address in a web browser.

Usage & Operations

  • Monitoring: Utilize tools like Prometheus and Grafana for monitoring the performance of your components housed within the network enclosure.
  • Maintenance: Regularly update the firmware and software of your devices to ensure optimal performance and security.
  • Backup and Recovery: Implement a robust backup strategy for all data stored on devices within the network enclosure to protect against data loss.
  • Scaling: Expand the capacity of the network enclosure as needed by adding additional components or upgrading existing ones.

Troubleshooting

  • Container not starting: Check the container logs for error messages and ensure that all necessary services are properly configured.
  • Network connectivity issues: Verify that the correct IP addresses, subnet masks, and gateways are assigned to your devices within the network enclosure.
  • Performance problems: Optimize the web interface and device configurations to minimize resource usage and improve overall performance.
  • Security concerns: Implement best practices such as strong passwords, regular updates, and firewall rules to protect your devices from potential threats.

Conclusion

In this guide, we have walked you through building a custom network enclosure for your WiFi gear using Docker. By implementing this solution, you can create a clean and organized homelab environment while keeping your equipment safe from curious hands. Keep exploring advanced topics such as container orchestration with Kubernetes or integrating additional services into your network enclosure UI for an even more powerful homelab setup.

For further learning resources, refer to the official Docker documentation, Kubernetes documentation, and various tutorials on building custom web interfaces using HTML, CSS, and JavaScript. Happy homelabbing!

This post is licensed under CC BY 4.0 by the author.