Skip to main content

Provider Guide — VNF Setup

This guide covers everything a cloud provider / CloudStack administrator must prepare before customers can deploy VNF appliances.

Audience

This page is for cloud providers and platform administrators. If you are an end customer deploying pfSense, see the pfSense Deployment Guide.


Provider workflow overview​


Phase 1 — Physical network preparation​

CloudStack cannot make VNF networking work if the underlying physical infrastructure is not correctly prepared. This phase is entirely outside CloudStack.

What must be in place​

RequirementDetails
VLANs defined on physical switchesAt minimum: WAN VLAN, Customer LAN VLAN, Management VLAN
VLAN trunking to CloudStack hostsAll CloudStack hypervisor hosts that run VNF appliances must trunk the required VLANs
Upstream connectivityWAN VLAN must route to upstream internet or datacenter edge
IP addressing planProvider defines CIDR ranges per VLAN

Example VLAN plan​

VLANNameExample CIDRPurpose
100Provider-WAN203.0.113.0/24pfSense upstream / internet
200Customer-LAN10.10.10.0/24Workload VMs + pfSense LAN
300VNF-Management10.20.0.0/24pfSense admin UI access

Note: These are illustrative examples. Use your actual network plan. VLAN IDs and CIDRs are arbitrary — the critical requirement is that the hypervisor hosts carrying these VMs can actually pass this traffic.

Separation of responsibilities by layer​

Physical switch config ← Network team / datacenter
Hypervisor VLAN trunking ← CloudStack host config / admin
CloudStack physical network ← CloudStack admin
CloudStack guest network ← CloudStack admin (creates network offerings/networks)
pfSense configuration ← Customer (after VNF is deployed)

Phase 2 — CloudStack network creation​

Create three CloudStack guest networks that map to the VLANs above.

Network A — Provider-WAN​

This is the upstream-facing network for pfSense's WAN NIC.

SettingExample value
NameProvider-WAN
TypeShared or L2 (provider decides based on topology)
VLAN100
PurposeConnect pfSense WAN to upstream / internet
AccessProvider-controlled; customers select it during VNF deployment

Network B — Customer-LAN​

This is the workload network. Both the pfSense LAN NIC and workload VMs attach here.

SettingExample value
NameCustomer-LAN
TypeL2 (recommended)
VLAN200
PurposepfSense LAN + customer workload VMs
GatewayNone from CloudStack — pfSense provides it
Why L2 here?

An L2 network does not deploy a CloudStack Virtual Router. This prevents the VR from becoming the gateway and bypassing pfSense. The customer configures pfSense to be the DHCP server and gateway for this segment.

Network C — VNF-Management​

Provides administrative access to the pfSense UI.

SettingExample value
NameVNF-Management
TypeIsolated (preferred) or Shared
VLAN300
PurposeAccess pfSense HTTPS UI
NotesCloudStack can automatically configure public IP + firewall rules if using Isolated network with the management NIC

Persistent networks​

For VNF/firewall appliances, consider marking the Customer-LAN as a persistent network. A persistent network continues to exist even when no workload VMs are attached, which is important when the pfSense appliance should have a lifecycle independent of application VMs.

CloudStack 4.22 documents persistent networks as networks that can be provisioned even when no instances are running and notes they are useful for physical devices and network appliances.


Phase 3 — Prepare the pfSense VNF template​

Step 1 — Upload or identify the pfSense image​

Upload a pfSense image compatible with your CloudStack hypervisor (KVM or VMware). The template must be:

  • Registered in CloudStack as a standard VM template first
  • Bootable and tested

Step 2 — Register as a VNF template​

In CloudStack, a VNF template is a regular VM template with additional VNF metadata. Use the CloudStack UI or API to:

  1. Navigate to the template.
  2. Enable the VNF option (CloudStack 4.20+).
  3. Define VNF NICs.
  4. Define VNF Details.

Refer to the CloudStack 4.22 VNF documentation for the exact UI path and API parameters.

Step 3 — Define VNF NICs​

VNF NICs define the role of each network interface on the appliance. CloudStack uses these during deployment to present the correct NIC-to-network mapping UI to the customer.

Device IDNameRequiredManagementPurpose
0WANYesNoInternet / upstream network
1LANYesNoCustomer workload network
2MGMTYesYespfSense administration UI
NIC ordering is critical

The Device ID determines which CloudStack-assigned network interface maps to which physical NIC inside the pfSense VM. If the order does not match what pfSense expects (e.g. vtnet0 = WAN, vtnet1 = LAN), pfSense may boot with WAN/LAN swapped. Always validate NIC ordering in a test deployment before publishing the template.

VNF NIC field reference:

FieldDescription
Device IDSequential integer starting at 0. Must be consecutive.
NameHuman-readable label (WAN, LAN, MGMT, DMZ, etc.)
RequiredIf true, the customer must select a network for this NIC during deployment.
ManagementIf true, CloudStack may use this NIC for automated management access (public IP + firewall rules), depending on the network type.
CloudStack — Add VNF nic dialog showing Device ID, Name, Required toggle, and Management NIC toggle
Open full size

Step 4 — Define VNF Details (metadata)​

VNF details provide deployment and access metadata.

KeyExample valuePurpose
VENDORpfSenseAppliance vendor name
VERSION2.7.2Supported version
MAINTAINERYourCloudProviderContact for template issues
ACCESS_METHODShttpsHow to reach the management UI
HTTPS_PORT443HTTPS port
HTTPS_PATH/URL path to management UI
Do not hardcode production credentials

Do not embed real production passwords in a publicly available VNF template. The template should contain only the metadata needed for deployment and access discovery. Credentials should be generated or provided securely at deployment time, then changed immediately by the customer.

Step 5 — Management NIC behavior​

CloudStack's behavior for the management NIC access depends on the type of network the management NIC is attached to:

Management NIC network typeCloudStack behavior
Isolated networkCan automatically acquire public IP + create static NAT + firewall rules for configured ACCESS_METHODS
Shared with security groupsCan create required security group rules
L2 / VPC tier / Shared without security groupsDoes not automatically configure management access rules

This means: if you want CloudStack to automatically expose the pfSense management UI, use an Isolated network for the management NIC.


Phase 4 — Validation checklist​

Before publishing the VNF template for customers, validate a complete test deployment.

Template validation​

  • Correct OS image and architecture
  • Template marked as VNF
  • NIC Device IDs are consecutive (0, 1, 2)
  • NIC ordering matches pfSense interface order (vtnet0/em0 = WAN, etc.)
  • Management NIC correctly marked
  • Required NICs correctly marked
  • VNF metadata (vendor, version, access methods) populated

Network validation​

  • Provider-WAN: pfSense WAN NIC receives IP / connectivity confirmed
  • Customer-LAN: pfSense LAN NIC up and reachable from test VM
  • VNF-Management: pfSense HTTPS UI accessible
  • VLAN trunking working on all relevant hosts
  • Outbound NAT: test VM → Internet confirmed
  • Inbound port forwarding: external → test VM confirmed

Functional validation​

  • pfSense boots correctly after VNF deployment
  • Correct interface assignment (WAN ≠ LAN, no swap)
  • DHCP server active on LAN (if provider default config includes it)
  • Routing working (test VM gets internet through pfSense)
  • VM → pfSense LAN: ping ✅
  • pfSense WAN → upstream: ping ✅
  • Stop → start cycle: appliance recovers correctly
  • Reboot: appliance recovers correctly

Security validation​

  • Management UI is not publicly exposed without firewall rules
  • Default credentials changed from template defaults
  • No unnecessary public-facing ports open
  • Logging/monitoring strategy defined
Two different validations

"CloudStack VNF deploys successfully" ≠ "pfSense actually routes customer traffic."

Both must be validated separately. The first confirms the CloudStack/CMP deployment pipeline works. The second confirms the network topology is correct and traffic actually traverses pfSense.


Phase 5 — Define supported deployment profiles​

Rather than allowing customers to map any arbitrary NIC combination, the provider should document and test specific VNF deployment profiles.

ProfileNICsUse case
Profile 1 — Basic FirewallWAN + LANSimple internet gateway + firewall
Profile 2 — Firewall + ManagementWAN + LAN + MGMTManaged firewall with dedicated admin access
Profile 3 — Firewall + DMZWAN + LAN + DMZ + MGMTMulti-segment with separate DMZ
Profile 4 — HA FirewallWAN + LAN + SYNC + MGMTActive-passive HA (see Production architecture)

Document each profile with:

  • Expected NIC-to-network mapping
  • Validated traffic paths
  • Customer configuration instructions

Production architecture​

After validating the basic architecture, a production pfSense deployment typically includes:

High availability​

A real HA configuration requires careful network design. It is not simply "deploy two pfSense VMs."

Internet
│
┌───────┴───────┐
│ │
pfSense-1 pfSense-2
(Active) (Passive)
│ │
└───────┬───────┘
│
Customer-LAN
│
Workload VMs

Provider responsibilities for HA:

  • CARP/VRRP-capable networks (the sync NIC needs its own VLAN/network)
  • Anti-affinity rules to place pfSense-1 and pfSense-2 on different hypervisor hosts
  • CloudStack API: use VM placement (anti-affinity groups)

pfSense responsibilities for HA:

  • CARP virtual IP configuration
  • State synchronization (pfsync)
  • Failover testing
HA ComponentResponsibility
Anti-affinity VM placementCloudStack admin (anti-affinity groups)
SYNC network / VLANProvider
CARP / VRRP IPCustomer (pfSense config)
pfsync state syncCustomer (pfSense config)
Failover testingCustomer + Provider validation

Resource sizing guidance​

ComponentMinimumRecommended (production)
vCPU12–4
RAM1 GB2–4 GB
Storage8 GB20 GB (logs + packages)
NICs2 (WAN + LAN)3 (+ Management)

CMP automation considerations​

The above manual workflow can eventually be automated from CMP. Conceptually:

Customer clicks: "Deploy pfSense Firewall"
│
CMP validates selected zone and network availability
│
CMP calls CloudStack API: deployVirtualMachine (VNF template)
│
CMP maps VNF NICs → provider-defined networks
│
CloudStack provisions appliance
│
CMP returns management URL and credentials to customer
│
Customer configures pfSense (manual or CMP-assisted)

What CloudStack API handles: VM deployment, NIC attachment, public IP allocation (if applicable).

What CMP must orchestrate: Network validation, VNF profile selection, credential management, post-deploy guidance.

What requires pfSense-specific integration: Automated firewall rule creation, NAT configuration (requires pfSense API — not a CloudStack function).


Was this page helpful?
Found something that could be improved?