generated from professional-service-best-practices/best-practice-template
Deploy a OPNsense Firewall on STACKIT
- HCL 100%
| .forgejo | ||
| .gitignore | ||
| .terraform-version | ||
| .terraform.lock.hcl | ||
| 00-provider.tf | ||
| 01-config.tf | ||
| 02-opnsense-image.tf | ||
| 03-opnsense-network.tf | ||
| 04-opnsense-appliance.tf | ||
| CHANGELOG.md | ||
| LICENSE | ||
| MAINTAINERS.md | ||
| opnsense.qcow2 | ||
| README.md | ||
OPNsense Terraform Deployment
Terraform script to deploy an OPNsense firewall into STACKIT Cloud.
The Terraform deployment consists of:
- WAN Network
- LAN Network
- pfSense firewall VM + disk volume
- FloatingIP for firewall VM
- deactivating port security on firewall ports
Default Configuration
Interfaces
vtnet0WANvtnet1LAN
NAT
Masqurade (Outbound NAT) Traffic from LAN to WAN
Password
Set default password for admin to STACKIT123!
Interface Access
Disabled Referer-Check Enable allow all wan adresses to connect to the WebUI
Now you can enter the WebUI via the FloatingIP on port 443 the default login is admin:STACKIT123!
How to Use
Requirements:
- Terraform installed
- Access to a STACKIT project
- STACKIT Service Account Key
Follow these steps to implement the template:
-
Clone the repository:
git clone https://professional-service.git.onstackit.cloud/professional-service-best-practices/terraform-deployment-opnsense cd terraform-deployment-opnsense -
Configure the variables:
- Create a
01-config.tffile or set environment variables as described in the Configuration section below.
- Create a
-
Create & Save a STACKIT Service Account Token and place it in the
secrets.jsonfile. -
Initialize and apply:
terraform init terraform plan terraform apply
Configuration
The following variables can be configured.
| Variable Name | Description | Type | Default Value | Required |
|---|---|---|---|---|
project_id |
The STACKIT project ID. | string |
null |
Yes |
region |
The region where resources will be created. | string |
eu01 |
No |
zone |
The STACKIT Availability Zone | string |
eu01-3 |
No |
flavor |
Intel Gen3 Flavor c3i.2 | string |
c3i.2 |
No |