Firewall Guide

    Installing pfSense on SOAHost VPS

    Deploy a powerful, open-source firewall and router platform on your SOAHost VPS. pfSense provides enterprise-grade network security, VPN services, and traffic management in the cloud. This guide will walk you through the entire process of setting up pfSense on a SOAHost VPS.

    KVM VPS
    pfSense Firewall
    ⏱️ 30-45 minutes

    Why Run pfSense on a VPS?

    • Cost-effective: No need for dedicated hardware
    • Scalability: Easy to upgrade resources as needed
    • Remote management: Access your firewall from anywhere
    • High availability: Benefit from datacenter infrastructure
    • Testing environment: Perfect for learning and experimentation

    Important Note: This setup is primarily for testing, learning, or specific use cases. For production environments protecting physical networks, dedicated hardware is typically preferred.

    STEP 1

    Prerequisites

    Before starting, ensure you have the following requirements:

    • A SOAHost KVM VPS with at least 1GB RAM (2GB recommended)
    • Root access to your VPS
    • Basic understanding of networking concepts
    • SSH client for remote access
    • VNC or console access through SOAHost control panel
    STEP 2

    Preparing Your SOAHost VPS

    Initial VPS Setup

    1. Order your VPS: Choose a KVM-based plan from SOAHost with sufficient resources
    2. Access your VPS: Use the provided IP address and root credentials to SSH into your server
    3. Update the system: Run initial updates on your base OS
    Update System
    # For Debian/Ubuntu base
    apt update && apt upgrade -y
    
    # For CentOS/RHEL base
    yum update -y

    Configure Virtual Network Interfaces

    Since pfSense expects separate WAN and LAN interfaces, you'll need to configure additional network interfaces:

    Network Interface Configuration
    # Check current network configuration
    ip addr show
    
    # Create additional virtual interface (example for Debian/Ubuntu)
    cat >> /etc/network/interfaces << EOF
    
    # Virtual LAN interface
    auto eth0:1
    iface eth0:1 inet static
    address 192.168.1.1
    netmask 255.255.255.0
    EOF
    STEP 3

    Downloading and Preparing pfSense

    Download pfSense ISO

    Download pfSense
    # Create working directory
    mkdir -p /opt/pfsense
    cd /opt/pfsense
    
    # Download latest pfSense CE ISO (adjust URL for current version)
    wget https://www.pfsense.org/download/mirror.php?section=downloads
    
    # Verify the download
    sha256sum pfSense-*.iso

    Prepare Installation Environment

    For VPS installation, you'll typically need to:

    1. Mount the ISO: Use your VPS provider's control panel to mount the pfSense ISO
    2. Boot from ISO: Configure your VPS to boot from the mounted ISO
    3. Access console: Use VNC or similar console access provided by SOAHost
    STEP 4

    Installing pfSense

    Boot and Initial Setup

    1. Boot from ISO: Restart your VPS and boot from the pfSense ISO
    2. Choose Installation: Select "Install pfSense"
    3. Disk Configuration: Choose your VPS disk for installation
    4. Complete Installation: Follow the installation wizard

    Post-Installation Configuration

    After installation completes:

    Post-Installation
    # Remove the ISO mount
    # Reboot the system
    reboot

    The system will boot into pfSense and present you with interface assignment options.

    Interface Assignment

    When prompted, configure your interfaces:

    Interface Assignment
    WAN interface: vtnet0 (your primary VPS interface)
    LAN interface: vtnet1 (virtual interface or secondary IP)
    STEP 5

    Basic Network Configuration

    Initial Network Setup

    1. Set WAN Interface: Configure with your VPS public IP, set gateway to your VPS provider's gateway, configure DNS servers
    2. Set LAN Interface: Use private IP range (192.168.1.1/24), enable DHCP if desired

    Example Network Configuration

    Network Configuration Example
    WAN (vtnet0):
    - IP Address: [Your VPS Public IP]
    - Subnet Mask: /24 (typically)
    - Gateway: [Provider Gateway]
    - DNS: 8.8.8.8, 1.1.1.1
    
    LAN (vtnet1):
    - IP Address: 192.168.1.1
    - Subnet Mask: 255.255.255.0 (/24)
    - DHCP Range: 192.168.1.100 - 192.168.1.200

    Basic Firewall Rules

    Firewall Rule Examples
    # Allow LAN to WAN (default)
    Action: Pass
    Interface: LAN
    Source: LAN subnets
    Destination: any
    
    # Block private networks on WAN
    Action: Block
    Interface: WAN
    Source: RFC1918 networks
    Destination: any
    
    # Allow specific services
    Action: Pass
    Interface: WAN
    Protocol: TCP
    Destination Port: 443 (HTTPS admin)

    DHCP Configuration

    DHCP Server Settings
    DHCP Server Settings:
    - Range: 192.168.1.100 - 192.168.1.200
    - DNS Servers: 8.8.8.8, 1.1.1.1
    - Domain: local.domain
    - Lease Time: 24 hours
    STEP 6

    Web Interface Access

    Enable Web Configurator

    1. Set Admin Password: Configure during initial setup
    2. Access Web Interface: Navigate to https://[LAN_IP]:443
    3. Complete Wizard: Run through the initial configuration wizard

    Security Considerations

    Security Setup
    # Change default passwords
    # Enable HTTPS with proper certificates
    # Configure appropriate firewall rules
    # Limit administrative access
    STEP 7

    Common Use Cases and Configurations

    Use Case 1: VPN Server

    Transform your pfSense VPS into a VPN server:

    1. Install OpenVPN Package: Navigate to System → Package Manager, Install OpenVPN Client Export package
    2. Configure OpenVPN Server: Go to VPN → OpenVPN → Servers, Create new server configuration, Generate certificates
    3. Export Client Configurations: Use Client Export tab to generate .ovpn files

    Use Case 2: Site-to-Site VPN

    Connect remote networks:

    1. Configure IPsec Tunnel: Navigate to VPN → IPsec, Create Phase 1 and Phase 2 configurations, Exchange pre-shared keys or certificates
    2. Set Up Routing: Configure static routes, Adjust firewall rules for tunnel traffic

    Use Case 3: Load Balancer

    Distribute traffic across multiple servers:

    1. Configure Virtual IPs: Go to Firewall → Virtual IPs, Add VIP for load balancing
    2. Set Up Server Pool: Navigate to Services → Load Balancer, Define server pools and health monitoring
    3. Create Load Balance Rule: Configure load balancing algorithm, Set up failover options
    STEP 8

    Monitoring and Maintenance

    System Monitoring

    Access monitoring tools through:

    • Status → System Logs: View system and firewall logs
    • Status → Monitoring: Real-time traffic graphs
    • Diagnostics → Traffic Capture: Packet analysis

    Regular Maintenance Tasks

    Maintenance Commands
    # Update pfSense regularly
    # Monitor resource usage
    # Review firewall logs
    # Backup configuration files
    # Test disaster recovery procedures

    Performance Optimization

    For VPS deployments:

    1. Resource Allocation: Monitor CPU and memory usage, Adjust VPS plan as needed
    2. Network Optimization: Tune network buffers, Optimize firewall rules, Use traffic shaping if needed
    STEP 9

    Backup and Recovery

    Configuration Backup

    1. Manual Backup: Go to Diagnostics → Backup & Restore, Download configuration XML
    2. Automated Backup: Install AutoConfigBackup package, Configure automatic cloud backups

    Disaster Recovery

    Recovery Planning
    # Document recovery procedures
    # Test restoration process
    # Maintain offline configuration copies
    # Plan for VPS provider outages
    STEP 10

    Troubleshooting Common Issues

    STEP 11

    Security Best Practices

    Hardening Your Installation

    1. Change Default Credentials: Never use default passwords
    2. Enable HTTPS: Use SSL certificates for web interface
    3. Limit Admin Access: Restrict administrative interface access
    4. Regular Updates: Keep pfSense updated to latest version
    5. Monitor Logs: Regularly review system and security logs

    Firewall Rule Best Practices

    Security Guidelines
    # Default deny policy
    # Least privilege principle
    # Regular rule audits
    # Proper rule documentation
    # Geographic blocking if needed

    Congratulations!

    You've successfully installed pfSense on your SOAHost VPS! You now have a powerful, enterprise-grade firewall and router platform running in the cloud. Remember to maintain regular backups, keep your system updated, and follow security best practices.

    The combination of pfSense's robust feature set and SOAHost's reliable VPS infrastructure creates a powerful platform for network security, VPN services, and traffic management.