No description
Find a file
2026-02-13 12:48:52 -05:00
.claude/commands Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
.crush/commands Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
.github/workflows vibe coded a crapton here 2025-10-08 13:53:38 -04:00
.opencode/command Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
_bmad Add some bmad stuff for testing 2026-02-03 11:38:15 -05:00
_bmad-output/implementation-artifacts Add Netbox provider integration for network documentation 2026-02-03 13:58:33 -05:00
bootstrap/playbooks vibe coded a crapton here 2025-10-08 13:53:38 -04:00
modules setup ports 7 and 8 for the router machine to start consuming tagged only traffic. need to make sure that i have a backdoor still though on the mgmt network 2026-02-09 18:25:45 -05:00
netbox vibe coded a crapton here 2025-10-08 13:53:38 -04:00
virtualization stupid fucking AI decided that the fucking configuration shouldnt be part of the repo because the configuration is *OBVIOUSLY* sensitive and not worth saving 2026-02-03 12:16:14 -05:00
webhook vibe coded a crapton here 2025-10-08 13:53:38 -04:00
.gitignore stupid fucking AI decided that the fucking configuration shouldnt be part of the repo because the configuration is *OBVIOUSLY* sensitive and not worth saving 2026-02-03 12:16:14 -05:00
.goosehints Update instructions a bit more 2025-11-01 13:22:59 -04:00
.terraform.lock.hcl inits at least 2025-10-08 13:59:51 -04:00
netbox.tf wtf is going on with the lan-4 2026-02-09 09:11:44 -05:00
network.auto.tfvars Fix the main network bits too 2026-02-13 12:48:52 -05:00
network.tf add stonks and pmxkids changes to get things going 2026-02-10 16:00:13 -05:00
opencode.json refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
plan.json add stonks and pmxkids changes to get things going 2026-02-10 16:00:13 -05:00
providers.tf inits at least 2025-10-08 13:59:51 -04:00
README.md Correct model number here 2025-10-30 09:58:47 -04:00
SINGLE_TRUNK_EXAMPLES.md refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
terraform.tfstate Fix the main network bits too 2026-02-13 12:48:52 -05:00
terraform.tfvars stupid fucking AI decided that the fucking configuration shouldnt be part of the repo because the configuration is *OBVIOUSLY* sensitive and not worth saving 2026-02-03 12:16:14 -05:00
TRUNK_DESIGN.md refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00
ultrafast_import.sh base config for the 100gbe switch, need to build out modules/switch/ to handle bonding too 2025-10-22 10:56:11 -04:00
ultrafast_import.tf.reference First pass at DRY for some bits 2025-10-23 18:39:21 -04:00
variables.tf Ok, now working through the 48port ultrafast switch. no longer using the 16port one for main network, need to move AP and other bits still 2026-02-09 11:26:12 -05:00
vlans.auto.tfvars Add a new wifiap vlan because omada is stupid and wont let me use 4094 there 2026-02-08 21:00:42 -05:00
vlans.tf refactor(trunk): enhance trunk module with improved provider handling and VLAN configuration 2026-02-03 11:35:24 -05:00

MikroTik CRS + Proxmox + NetBox — IaC Starter (Generated)

This repository contains a proof-of-concept Infrastructure-as-Code layout to manage:

What is included

  • network.tf — Main Terraform file to configure the MikroTik switches via the RouterOS Terraform provider.\n- modules/ — Directory containing reusable Terraform modules for switch, VLAN, and VM configurations
  • virtualization/ — Terraform code to create/manage VMs on Proxmox via the Telmate Proxmox provider.
  • netbox/ — YAML import file with the initial NetBox objects for this PoC.
  • bootstrap/ — Ansible playbook to bootstrap RouterOS for API/REST access and create an automation user.
  • webhook/ — Simple Flask webhook receiver to trigger CI runs.
  • .github/workflows/terraform.yml — GitHub Actions workflow for plan/apply (example).

Infrastructure Overview

This setup manages a complex network infrastructure with multiple VLANs and switch configurations:

MikroTik Switches Configuration

The infrastructure includes two MikroTik switches:

  1. gigabit-backbone (192.168.0.32)

    • CRS354-48P-4S+2Q+RM switch model
    • 48 Ethernet ports (ether1-ether48) with various configurations
    • 4 SFP+ ports for fiber connections
    • 2 QSFP+ ports for high-speed connections
    • VLAN tagging and trunking capabilities
  2. ultrafast (192.168.0.33)

    • CRS312+4C+8XG-RM switch model
    • 8 Ethernet ports with PoE support
    • Bonding interfaces for link aggregation
    • Jumbo frame support for high-performance networking

Network VLANs

The network is organized into multiple VLANs with different security levels:

  • Secure VLANs: LAN (VLAN 1), PRIVATE (VLAN 17)
  • Insecure VLANs: IoT (VLAN 8), MEDIA (VLAN 6), CAMSEC (VLAN 20), WORK (VLAN 72)
  • Special purpose VLANs: LTE (VLAN 3), HIGHAV (VLAN 4), JUMBO (VLAN 129)

Modules Directory Structure

The modules/ directory contains reusable Terraform modules:

switch Module

Configures MikroTik switches with complex bridge and VLAN functionality:

  • Bridge creation and configuration
  • Bridge port management with tagging and untagging
  • Ethernet interface configuration (PoE, MTU, flow control)
  • Bonding interface setup
  • VLAN filtering capabilities

vlan Module

Defines VLAN configurations for network segmentation:

  • VLAN ID assignment
  • VLAN name and description
  • Network subnet definitions
  • Reusable across multiple switch configurations

vm Module

Manages Proxmox virtual machines:

  • VM creation with specified resources (cores, memory)
  • Network interface configuration with VLAN tagging
  • Disk configuration
  • VM naming and node assignment

Key Features

  • Complex bridge configurations with VLAN filtering
  • Bonding interfaces for redundancy and increased bandwidth
  • Ethernet port configuration with MTU and PoE settings
  • Trunking of VLANs between switches using tagged port configurations
  • Integration with NetBox for network management

Important: This is a starting point. Do not store secrets in the repository. Use GitHub Secrets / Vault / SOPS / Ansible Vault to protect credentials. Test in a lab before applying to production.

Quickstart (local/lab)

  1. Update variables and provider credentials in the Terraform *.tfvars or environment variables. The files use variables and placeholders.
  2. Run the Ansible playbook in bootstrap/ to configure the switch so the RouterOS API/REST is available to Terraform.
  3. From the root directory run terraform init and terraform plan (or use CI).

See each directory for further notes and config examples.