Skip to main content

pfSense Deployment Guide

This guide walks customers through deploying a pfSense VNF firewall in CloudStack and connecting workload VMs through it.

Audience

This page is for end customers deploying pfSense as a firewall. Your cloud provider must have already published a pfSense VNF template and the required CloudStack networks before you begin. See the Provider Guide for prerequisites.


Architecture you will build​

Internet
│
Provider WAN Network
(203.0.113.0/24)
│
pfSense WAN NIC
203.0.113.10/24
│
┌─────────┴──────────┐
│ pfSense VNF │
│ Firewall + NAT │
└─────────┬──────────┘
│
pfSense LAN NIC
10.10.10.1/24
│
Customer-LAN (L2)
10.10.10.0/24
│
┌───────────┼───────────┐
│ │ │
web01 app01 db01
10.10.10.100 10.10.10.101 10.10.10.102
gw:10.10.10.1 gw:10.10.10.1 gw:10.10.10.1

IP addresses and VLAN IDs are examples. Your provider will supply the actual network names and CIDRs.


Customer workflow​


Step 1 — Deploy the pfSense VNF appliance​

Navigate to Networking → VNF Appliances → Add VNF Appliance in CMP (or CloudStack UI).

CloudStack — Add VNF Appliance page showing zone selection, template, compute offering, networks, and VNF NIC mapping
Open full size

1.1 Select the VNF template​

Select the pfSense VNF template published by your provider.

1.2 Select compute offering​

Choose a compute offering appropriate for your workload. Minimum recommended:

ResourceMinimumRecommended
vCPU12
RAM1 GB2 GB
Disk8 GB20 GB

1.3 Select networks​

Select the three networks required for a full pfSense deployment:

PurposeNetwork name (example)Notes
WANProvider-WANInternet/upstream facing
Customer LANCustomer-LANYour workload VMs attach here too
ManagementVNF-ManagementpfSense admin UI access
tip

Your provider will tell you the exact names of these networks. Do not create your own networks unless the provider has documented that step.

1.4 Map VNF NICs to networks​

CloudStack presents the VNF NIC mapping screen. Map each NIC role to its corresponding network:

VNF NICRoleSelect this network
NIC 0WANProvider-WAN
NIC 1LANCustomer-LAN
NIC 2MGMTVNF-Management
NIC mapping must match the template definition

The template provider has defined the expected NIC roles. Map them exactly as documented — swapping WAN and LAN will cause pfSense to boot with incorrect interface assignments and internet traffic will not work.

CMP — Create a Server page showing network selection and VNF NIC mapping (Device ID, Name, Required, Management NIC, Network columns)
Open full size

1.5 Deploy​

Click Deploy. Wait for the appliance status to show Running.


Step 2 — Access the pfSense management UI​

Once deployed, CloudStack provides access information based on the management NIC's network type. Your provider will document the exact method. Common options:

Management network typeHow to reach pfSense UI
Isolated networkCloudStack acquires a public IP + creates firewall rules automatically. Use the provided URL.
Shared / L2 management networkConnect from within the management VLAN. Use the management NIC IP directly.

Default pfSense access:

  • URL: https://<management-ip>/
  • Default username: admin
  • Default password: pfsense (change immediately)

Step 3 — Configure WAN interface​

In pfSense, go to Interfaces → WAN.

SettingExample valueNotes
IPv4 Configuration TypeStaticOr DHCP if the provider's WAN network provides DHCP
IPv4 Address203.0.113.10Your WAN IP from the provider
Subnet Mask24
Upstream Gateway203.0.113.1Provider's gateway — confirm with your provider

Click Save → Apply Changes.

Test WAN: In pfSense, go to Diagnostics → Ping and ping 8.8.8.8 from the WAN interface. If it replies, your upstream connectivity is working.


Step 4 — Configure LAN interface​

In pfSense, go to Interfaces → LAN.

SettingExample value
IPv4 Configuration TypeStatic
IPv4 Address10.10.10.1
Subnet Mask24

Click Save → Apply Changes.

Go to Services → DHCP Server → LAN.

SettingExample value
Enable✅ Checked
Range — From10.10.10.100
Range — To10.10.10.200
Gateway10.10.10.1
DNS Servers8.8.8.8, 8.8.4.4 (or pfSense itself)

Click Save.


Step 5 — Configure NAT​

pfSense uses Automatic Outbound NAT by default, which creates a NAT rule for your LAN subnet to go out through the WAN.

Verify: Firewall → NAT → Outbound — you should see an automatic rule for 10.10.10.0/24 → WAN address.

If not, switch to Hybrid Outbound NAT and add:

FieldValue
InterfaceWAN
Source10.10.10.0/24
TranslationInterface address

Step 6 — Configure firewall rules​

By default, pfSense's LAN interface allows all outbound traffic. Verify under Firewall → Rules → LAN:

  • A default "allow LAN to any" rule exists.
  • WAN rules: by default, inbound traffic from WAN is blocked (stateful firewall — return traffic for established connections is allowed automatically).

For the initial test, the defaults work. Tighten firewall rules based on your security requirements.


Step 7 — Create workload VM​

Create a normal VM in CMP/CloudStack.

7.1 Select network​

On the network selection screen, select Customer-LAN — the same L2 network attached to pfSense's LAN NIC.

Do NOT select an Isolated Network

If you attach your workload VM to a regular Isolated Network (not Customer-LAN), CloudStack's Virtual Router will be the gateway — not pfSense. Traffic will bypass your firewall entirely.

VNF does not appear as a network option

pfSense will not appear in the network selection list when creating a VM. That is expected and correct. Simply select Customer-LAN and the topology handles the routing relationship.

7.2 IP configuration​

If pfSense DHCP is enabled, the VM will receive:

SettingValue
IP10.10.10.100 (or next available)
Gateway10.10.10.1 (pfSense LAN IP)
DNSAs configured in pfSense DHCP

If using static IPs, configure the VM OS:

# Example — Ubuntu (adjust interface name)
ip addr add 10.10.10.100/24 dev eth0
ip route add default via 10.10.10.1
echo "nameserver 8.8.8.8" >> /etc/resolv.conf

Step 8 — Test connectivity​

Run these tests in order:

8.1 VM → pfSense LAN​

ping 10.10.10.1

✅ Expected: replies from pfSense LAN IP.

If this fails: Check that the VM is on Customer-LAN, that pfSense LAN interface is up, and that there are no Layer 2 issues on the network.

8.2 VM → pfSense WAN​

ping 203.0.113.10

✅ Expected: replies (if pfSense firewall allows ICMP from LAN to WAN — may need to enable in pfSense).

8.3 VM → Internet​

ping 8.8.8.8
curl https://google.com

✅ Expected: internet reachable through pfSense NAT.

If ping works but curl fails: Check DNS. Try curl https://8.8.8.8 or add a DNS server in pfSense DHCP settings.

8.4 Check NAT is working​

In pfSense: Status → Traffic Graphs or Diagnostics → States — you should see active states for your VM's outbound connections.


Step 9 — Port forwarding (publish a service)​

To expose a VM service on the internet:

Example: Expose web01 (10.10.10.101) web server on TCP 443.

9.1 Ensure a public IP is reachable on pfSense WAN​

Confirm with your provider that 203.0.113.20 (or another IP) routes to your pfSense WAN.

9.2 Add port forward rule in pfSense​

Go to Firewall → NAT → Port Forward → Add:

FieldValue
InterfaceWAN
ProtocolTCP
DestinationWAN address (or specific IP)
Destination Port Range443
Redirect Target IP10.10.10.101
Redirect Target Port443
Descriptionweb01 HTTPS

Click Save → Apply Changes.

pfSense automatically adds a matching firewall rule on WAN.

9.3 Traffic flow​

Internet
│
203.0.113.20:443
│
pfSense WAN
│ NAT/Port Forward
│
10.10.10.101:443
│
web01 VM

Troubleshooting​

VM cannot ping pfSense LAN (10.10.10.1)​

CheckAction
VM is on correct networkConfirm VM is attached to Customer-LAN (not an Isolated Network)
pfSense LAN interface is uppfSense UI → Status → Interfaces → LAN: Up?
NIC mapping is correctpfSense may have WAN/LAN swapped — check Interfaces → Assignments
VLAN trunkingConfirm the hypervisor host trunks VLAN 200 to both the VM and pfSense
pfSense LAN IPInterfaces → LAN should show 10.10.10.1

VM can ping pfSense but cannot reach Internet​

CheckAction
pfSense WAN connectivityDiagnostics → Ping → ping 8.8.8.8 from WAN interface
WAN gatewayInterfaces → WAN → Gateway configured and correct?
NAT ruleFirewall → NAT → Outbound — rule for LAN subnet exists?
Firewall rulesFirewall → Rules → LAN — allow LAN to any rule exists?
DNSTry ping 8.8.8.8 vs ping google.com to isolate DNS issues

pfSense management UI inaccessible​

CheckAction
Management NIC networkIs VNF-Management network reachable from your location?
CloudStack public IPDid CloudStack assign and configure a public IP for the management NIC?
pfSense HTTPS serviceIs the pfSense HTTPS service listening? Try from within pfSense console
Firewall / security groupsCheck any CloudStack firewall or security group rules on the management network
HTTPS portDefault is 443 — provider may have set a different port in VNF metadata

Traffic bypasses pfSense​

CheckAction
VM default gatewayIs the VM gateway set to 10.10.10.1 (pfSense LAN IP), not some other IP?
CloudStack Virtual RouterIs the VM on an Isolated Network (VR is gateway) instead of Customer-LAN (L2)?
Routing table on VMip route show — what is the default route?
pfSense interface assignmentAre WAN/LAN swapped? pfSense → Interfaces → Assignments

What pfSense provides vs what CloudStack provides​

FunctionWho provides it
VM deployment and NIC attachmentCloudStack
VNF template and NIC definitionsProvider
IP forwarding / routingpfSense (must be enabled in the OS)
DHCP for Customer-LAN VMspfSense (configured by customer)
NAT / outbound internetpfSense (Outbound NAT)
Firewall rulespfSense
Port forwardingpfSense
VPN (OpenVPN / IPSec / WireGuard)pfSense
DNS resolverpfSense (optional)
High availability / CARPpfSense + provider network design
Public IP assignmentCloudStack + Provider routing

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