← Back to Projects

Implementing Pfsense Firewall in VMware Clusters

Complete step-by-step guide to secure your virtual machine infrastructure

Network Security Infrastructure

Prerequisites & Planning

Before You Begin: Ensure you have VMware vSphere/ESXi access, sufficient resources (2GB RAM, 2 vCPUs minimum for Pfsense), and a clear understanding of your network topology.

Network Architecture Overview

Internet → WAN Interface (Pfsense) → LAN Interface → Protected VMs
                        ↓
                   DMZ Interface → Public Services

Step-by-Step Implementation

Step 1

Create Virtual Networks in VMware

Set up isolated network segments for proper traffic segmentation:

  • Create WAN Network: Connect to your physical network/internet
  • Create LAN Network: Internal protected network (e.g., 192.168.1.0/24)
  • Create DMZ Network: For public-facing services (e.g., 10.0.1.0/24)
  • Ensure networks are isolated from each other in vSwitch configuration
Step 2

Deploy Pfsense Virtual Machine

  • Create new VM: Allocate 2GB RAM, 2 vCPUs, 20GB storage minimum
  • Add network adapters: Configure 3 NICs (WAN, LAN, DMZ)
  • Mount Pfsense ISO: Attach downloaded ISO to VM
  • Boot and install: Follow Pfsense installation wizard
VM Configuration: - NIC 1: WAN Network (vmxnet3) - NIC 2: LAN Network (vmxnet3) - NIC 3: DMZ Network (vmxnet3)
Step 3

Initial Pfsense Configuration

  • Console setup: Access VM console and run initial configuration
  • Assign interfaces: Map physical NICs to WAN/LAN/DMZ roles
  • Set IP addresses: Configure static IPs for each interface
  • Enable DHCP: Configure DHCP server for LAN segment
Example Interface Assignment: WAN: DHCP or Static Public IP LAN: 192.168.1.1/24 (DHCP: 192.168.1.100-200) DMZ: 10.0.1.1/24 (Static assignments recommended)
Step 4

Migrate VMs to Protected Networks

Important: Schedule this during maintenance window as VMs will lose connectivity temporarily.
  • Power down VMs: Gracefully shutdown target virtual machines
  • Change network assignment: Move VM NICs from direct networks to LAN/DMZ
  • Update VM network settings: Change to DHCP or update static IPs for new subnets
  • Power on VMs: Start VMs and verify connectivity through Pfsense
Step 5

Configure Firewall Rules

Access Pfsense web interface (https://192.168.1.1) and configure security rules:

  • Default LAN rules: Allow outbound, block unnecessary inbound
  • DMZ rules: Allow specific ports for public services only
  • Inter-VLAN rules: Control communication between LAN and DMZ
  • WAN rules: Block all inbound except required services
Common Rule Examples: LAN→WAN: Allow all outbound (HTTP, HTTPS, DNS, NTP) WAN→DMZ: Allow only ports 80, 443 for web servers LAN→DMZ: Allow specific management ports only DMZ→LAN: Block all (default deny)
Step 6

Enable Advanced Security Features

  • Intrusion Detection (Suricata/Snort): Install and configure IDS package
  • DNS Filtering: Enable pfBlockerNG for malware/ad blocking
  • VPN Access: Configure OpenVPN for secure remote access
  • Traffic Monitoring: Set up Ntopng for network visibility
  • Backup/Restore: Configure automatic configuration backups
Step 7

Implement Monitoring & Logging

  • Syslog configuration: Forward logs to SIEM/centralized logging
  • SNMP monitoring: Enable for network monitoring tools
  • Alert rules: Configure notifications for security events
  • Performance monitoring: Set up CPU/memory/bandwidth alerts
Syslog forwarding to Splunk/Graylog: System → Advanced → Miscellaneous Remote Syslog Server: [SIEM_IP]:514 Remote Syslog Contents: Everything
Step 8

Testing & Validation

  • Connectivity tests: Verify VM internet access and internal communication
  • Security testing: Use nmap to verify firewall rules are working
  • Performance testing: Check throughput and latency impact
  • Failover testing: Test VM behavior during Pfsense maintenance
  • Documentation: Document final configuration and procedures

Post-Implementation Security Hardening

Security Best Practices: These additional steps will maximize your protection level.

Troubleshooting Common Issues

VM Connectivity Problems

Performance Issues

Emergency Access: Always maintain a management interface that bypasses Pfsense for emergency access to your VMware infrastructure.