### Virtualizing with Proxmox® VE Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html This example provides guidance on virtualizing pfSense software using the Proxmox Virtual Environment (VE). It covers the setup process for Proxmox. ```text Virtualizing with Proxmox® VE ``` -------------------------------- ### Install and run trafshow Source: https://docs.netgate.com/pfsense/en/latest/monitoring/graphs/bandwidth-usage.html Install the trafshow package via CLI and execute it to view real-time throughput. ```bash pkg install trafshow ``` ```bash rehash ``` ```bash trafshow ``` -------------------------------- ### Install a Package using pkg install Source: https://docs.netgate.com/pfsense/en/latest/recipes/freebsd-pkg-repo.html Use this command to install packages from the Netgate package repository. Ensure the package is available in the repository. ```bash # pkg install screen ``` -------------------------------- ### Example Firmware Filename Source: https://docs.netgate.com/pfsense/en/latest/solutions/sg-3100/reinstall-pfsense.html This is an example of the firmware file name you will receive when requesting access to the Plus firmware. ```text pfSense-plus-Netgate-3100-recovery-26.03-RELEASE-armv7.img.gz ``` -------------------------------- ### Interactive Program Notice Example Source: https://docs.netgate.com/pfsense/en/latest/licensing/licensetext/perl5_GPLv1%2B.html Example of a short notice to display when an interactive program starts, informing users about its version, warranty, and redistribution terms. ```text Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. ``` -------------------------------- ### Full Workflow Example Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html A complete sequence from inserting the drive to unmounting it. ```shell # Insert the USB drive # Find the label : ls -l /dev/msdosfs/ crw-r----- 1 root operator 0x93 Jul 8 13:56 MYDRIVE # Create the mountpoint : mkdir /root/usb # Mount the drive : mount -t msdosfs /dev/msdosfs/MYDRIVE /root/usb # Copy files : cp /conf/config.xml /root/usb/config-backup.xml # Unmount the drive : umount /root/usb/ ``` -------------------------------- ### Full Example Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html This section provides a complete, end-to-end example of copying files to a USB drive in pfSense, integrating all previous steps. ```text Full Example ``` -------------------------------- ### Installing OpenVPN Remote Access Clients Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html This recipe guides users through the process of installing OpenVPN remote access client software. It ensures users can connect to the VPN. ```text Installing OpenVPN Remote Access Clients ``` -------------------------------- ### Iterate over OpenVPN instances Source: https://docs.netgate.com/pfsense/en/latest/development/php-config-arrays.html Demonstrates replacing manual initialization and nested checks with config_get_path. ```php init_config_arr(array('openvpn')); foreach (array('server', 'client') as $mode) { if (is_array($config['openvpn']["openvpn-{$mode}"])) { foreach ($config['openvpn']["openvpn-{$mode}"] as $id => $setting) { /* ... */ } } } ``` ```php foreach (array('server', 'client') as $mode) { foreach (config_get_path("openvpn/openvpn-{$mode}", []) as $id => $setting) { /* ... */ } } ``` -------------------------------- ### Run Recovery Command Source: https://docs.netgate.com/pfsense/en/latest/solutions/sg-3100/reinstall-pfsense.html Type `run recovery` at the `Marvell>>` prompt to start the software installation. ```bash run recovery ``` -------------------------------- ### WireGuard Client Configuration (Full-Tunnel) Source: https://docs.netgate.com/pfsense/en/latest/recipes/wireguard-ra.html Example WireGuard client configuration for a full-tunnel setup. This configuration routes all traffic (0.0.0.0/0) through the VPN, including internet traffic. ```ini [Interface] PrivateKey = WGpL3/ejM5L9ngLoAtXkSP1QTNp4eSD34Zh6/Jfni1Q= ListenPort = 51820 DNS = 10.6.210.1, pfSense.home.arpa Address = 10.6.210.2/24 [Peer] PublicKey = PUVBJ+zuz/0mRPEB4tIaVbet5NzVwdWMX7crGx+/wDs= AllowedIPs = 0.0.0.0/0 Endpoint = 198.51.100.6:51820 ``` -------------------------------- ### Build and deploy a package Source: https://docs.netgate.com/pfsense/en/latest/development/develop-packages.html Workflow for cloning the ports repository, making changes, building the package, and copying it to the firewall. ```bash $ git clone git@github.com:pfsense/FreeBSD-ports.git pfSense-ports $ cd pfSense-ports/blah/pfSense-pkg-foo/ [hack, hack, hack] $ make package (might need sudo) $ scp work/pkg/pfSense-pkg-foo* root@myfirewall:. ``` -------------------------------- ### PHP Shell Session Example Source: https://docs.netgate.com/pfsense/en/latest/development/php-shell.html An example session showing the output of the help command and various configuration manipulation techniques within the pfSense developer shell. ```php *** Welcome to pfSense *** WAN (wan) -> vmx0 -> v4/DHCP4: 198.51.100.3/24 v6/DHCP6: 2001:db8::ffff:22d6/128 LAN (lan) -> vmx1 -> v4: 10.3.0.1/24 v6/t6: 2001:db8:1:eee0:20c:29ff:fe45:260/60 0) Logout (SSH only) 9) pfTop 1) Assign Interfaces 10) Filter Logs 2) Set interface(s) IP address 11) Restart GUI 3) Reset admin account and password 12) PHP shell + pfSense tools 4) Reset to factory defaults 13) Update from console 5) Reboot system 14) Disable Secure Shell (sshd) 6) Halt system 15) Restore recent configuration 7) Ping host 16) Restart PHP-FPM 8) Shell Enter an option: 12 Starting the pfSense developer shell.... Welcome to the pfSense developer shell Type "help" to show common usage scenarios. Available playback commands: changepassword disablecarp disabledhcpd disablereferercheck enableallowallwan enablecarp enablesshd externalconfiglocator generateguicert gitsync installpkg listpkg removepkgconfig removeshaper restartdhcpd restartipsec svc uninstallpkg pfSense shell: help Enter a series of commands and then execute the set with "exec". For example: echo "foo"; // php command echo "foo2"; // php command ! echo "heh" # shell command exec Example commands: record stoprecording showrecordings parse_config(true); # reloads the $config array $temp = print_r($config, true); more($temp); /* to output a configuration array */ print_r($config); /* to output the interfaces configuration portion of config.xml */ print_r($config['interfaces']); /* to output the dhcp server configuration */ print_r($config['dhcpd']); /* to exit the developer shell */ exit /* to output possible wireless modes for an interface */ print_r(get_wireless_modes("ath0")); /* to enable SSH */ $config['system']['enablesshd'] = true; /* change OPTX to the OPT interface name such as BACKHAUL */ $config['interfaces']['optx']['wireless']['standard'] = "11a"; $config['interfaces']['optx']['wireless']['mode'] = "hostap"; $config['interfaces']['optx']['wireless']['channel'] = "6"; /* to enable dhcp server for an optx interface */ $config['dhcpd']['optx']['enable'] = true; $config['dhcpd']['optx']['range']['from'] = "192.168.31.100"; $config['dhcpd']['optx']['range']['to'] = "192.168.31.150"; /* to disable the firewall filter */ $config['system']['disablefilter'] = true; /* to enable an interface and configure it as a DHCP client */ $config['interfaces']['optx']['disabled'] = false; $config['interfaces']['optx']['ipaddr'] = "dhcp"; /* to enable an interface and set a static IPv4 address */ $config['interfaces']['wan']['enable'] = true; $config['interfaces']['wan']['ipaddr'] = "192.168.100.1"; $config['interfaces']['wan']['subnet'] = "24"; /* to save out the new configuration (config.xml) */ write_config(); /* to reboot the system after saving */ system_reboot_sync(); ``` -------------------------------- ### Using External Wireless Access Points Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html This example demonstrates how to integrate and manage external wireless access points with pfSense software. It covers network setup for wireless connectivity. ```text Using External Wireless Access Points ``` -------------------------------- ### WireGuard Client Configuration (Split-Tunnel) Source: https://docs.netgate.com/pfsense/en/latest/recipes/wireguard-ra.html Example WireGuard client configuration for a split-tunnel setup. This configuration routes specific IP ranges through the VPN while other traffic goes directly to the internet. ```ini [Interface] PrivateKey = WGpL3/ejM5L9ngLoAtXkSP1QTNp4eSD34Zh6/Jfni1Q= ListenPort = 51820 Address = 10.6.210.2/24 [Peer] PublicKey = PUVBJ+zuz/0mRPEB4tIaVbet5NzVwdWMX7crGx+/wDs= AllowedIPs = 10.6.210.1/32, 10.6.0.0/24 Endpoint = 198.51.100.6:51820 ``` -------------------------------- ### Install pfSense Repository and Upgrade Script Source: https://docs.netgate.com/pfsense/en/latest/releases/2-3-5.html Run these commands from the console or shell to ensure the firewall has the correct repository configuration and upgrade script for 2.3.x if an update to 2.3.5 is offered but will not proceed. ```bash pkg install -fy pfSense-repo pfSense-upgrade ``` -------------------------------- ### High Availability Configuration Example with Multi-WAN Source: https://docs.netgate.com/pfsense/en/latest/recipes/usb-drive-copy.html This recipe details a High Availability (HA) setup for pfSense software that includes multiple WAN connections. It is useful for load balancing and failover. ```text High Availability Configuration Example with Multi-WAN ``` -------------------------------- ### Add Host Entry for pfSense Firewall Source: https://docs.netgate.com/pfsense/en/latest/monitoring/logs/remote.html An entry may need to be added in `/etc/hosts` for the pfSense firewall, depending on your DNS setup. This example maps an IP address to a hostname and its FQDN. ```shell 192.168.1.1 pfsense pfsense.example.com ``` -------------------------------- ### Install Git Package Source: https://docs.netgate.com/pfsense/en/latest/development/gitsync.html Manually install the git package if the gitsync script fails to install it automatically. ```shell # pkg install git ``` -------------------------------- ### Manual AutoConfigBackup Log Entry Example Source: https://docs.netgate.com/pfsense/en/latest/backup/acb-status.html Sample log output generated during a manual configuration backup process. ```text /services_acb_backup.php: Staging AutoConfigBackup encrypted configuration backup for deferred upload to https://acb.netgate.com /usr/local/sbin/acbupload.php: Starting upload of staged AutoConfigBackup encrypted configuration backups to https://acb.netgate.com /usr/local/sbin/acbupload.php: Completed AutoConfigBackup encrypted configuration backup upload to https://acb.netgate.com (success) ```