The Pfsense Book Release
Total Page:16
File Type:pdf, Size:1020Kb
The pfSense Book Release The pfSense Team May 10, 2017 CONTENTS 1 Preface 1 1.1 Acknowledgements...........................................1 1.2 Feedback.................................................3 1.3 Typographic Conventions........................................3 1.4 Authors..................................................4 2 Foreword 7 3 Introduction 9 3.1 What does pfSense stand for/mean?...................................9 3.2 Why FreeBSD?..............................................9 3.3 Common Deployments.......................................... 10 3.4 Interface Naming Terminology..................................... 11 3.5 Finding Information and Getting Help.................................. 12 3.6 Project Inception............................................. 13 4 Networking Concepts 15 4.1 Understanding Public and Private IP Addresses............................. 15 4.2 IP Subnetting Concepts......................................... 16 4.3 IP Address, Subnet and Gateway Configuration............................. 16 4.4 Understanding CIDR Subnet Mask Notation.............................. 17 4.5 CIDR Summarization.......................................... 18 4.6 Broadcast Domains............................................ 19 4.7 IPv6.................................................... 19 4.8 Brief introduction to OSI Model Layers................................. 32 5 Hardware 33 5.1 Minimum Hardware Requirements................................... 33 5.2 Hardware Selection........................................... 33 5.3 Hardware Sizing Guidance........................................ 34 5.4 Hardware Tuning and Troubleshooting................................. 38 5.5 Hardware Compatibility......................................... 39 6 Installing and Upgrading 41 6.1 Download Installation Media...................................... 41 6.2 Prepare Installation Media........................................ 43 6.3 Connect to the Console.......................................... 48 6.4 Perform the Installation......................................... 51 6.5 Assign Interfaces............................................. 55 6.6 Alternate Installation Techniques.................................... 57 6.7 Installation Troubleshooting....................................... 58 i 6.8 Upgrading an Existing Installation.................................... 60 6.9 Filesystem Tweaks............................................ 63 7 Configuration 65 7.1 Setup Wizard............................................... 65 7.2 Interface Configuration.......................................... 72 7.3 Managing Lists in the GUI........................................ 74 7.4 Quickly Navigate the GUI with Shortcuts................................ 74 7.5 General Configuration Options...................................... 75 7.6 Advanced Configuration Options.................................... 77 7.7 Console Menu Basics.......................................... 98 7.8 Time Synchronization.......................................... 104 7.9 Troubleshooting............................................. 106 7.10 pfSense XML Configuration File.................................... 109 7.11 What to do when locked out of the WebGUI.............................. 110 7.12 Connecting to the WebGUI....................................... 114 8 Interface Types and Configuration 117 8.1 Interface Groups............................................. 117 8.2 Wireless................................................. 119 8.3 VLANs.................................................. 119 8.4 QinQs................................................... 119 8.5 Bridges.................................................. 119 8.6 OpenVPN................................................ 119 8.7 PPPs................................................... 120 8.8 GRE (Generic Routing Encapsulation)................................. 123 8.9 GIF (Generic tunnel InterFace)..................................... 123 8.10 LAGG (Link Aggregation)........................................ 124 8.11 Interface Configuration.......................................... 126 8.12 IPv4 WAN Types............................................. 128 8.13 IPv6 WAN Types............................................. 130 8.14 Physical and Virtual Interfaces...................................... 132 9 User Management and Authentication 133 9.1 User Management............................................ 133 9.2 Authentication Servers.......................................... 136 9.3 External Authentication Examples.................................... 139 9.4 Troubleshooting............................................. 141 9.5 Support Throughout pfSense....................................... 143 10 Certificate Management 145 10.1 Certificate Authority Management.................................... 145 10.2 Certificate Management......................................... 148 10.3 Certificate Revocation List Management................................ 152 10.4 Basic Introduction to X.509 Public Key Infrastructure......................... 154 11 Backup and Recovery 157 11.1 Making Backups in the WebGUI..................................... 157 11.2 Using the AutoConfigBackup Package................................. 157 11.3 Alternate Remote Backup Techniques.................................. 160 11.4 Restoring from Backups......................................... 161 11.5 Backup Files and Directories with the Backup Package......................... 164 11.6 Caveats and Gotchas........................................... 165 11.7 Backup Strategies............................................ 166 ii 12 Firewall 167 12.1 Firewalling Fundamentals........................................ 167 12.2 Ingress Filtering............................................. 169 12.3 Egress Filtering.............................................. 169 12.4 Introduction to the Firewall Rules screen................................ 172 12.5 Aliases.................................................. 176 12.6 Firewall Rule Best Practices....................................... 183 12.7 Rule Methodology............................................ 185 12.8 Configuring firewall rules........................................ 190 12.9 Floating Rules.............................................. 196 12.10 Methods of Using Additional Public IP Addresses........................... 198 12.11 Virtual IP Addresses........................................... 201 12.12 Time Based Rules............................................ 203 12.13 Viewing the Firewall Logs........................................ 205 12.14 How Do I Block access to a Web Site?................................. 209 12.15 Troubleshooting Firewall Rules..................................... 210 13 Network Address Translation 213 13.1 Port Forwards.............................................. 213 13.2 1:1 NAT................................................. 219 13.3 Ordering of NAT and Firewall Processing................................ 222 13.4 NAT Reflection.............................................. 224 13.5 Outbound NAT.............................................. 227 13.6 Choosing a NAT Configuration..................................... 230 13.7 NAT and Protocol Compatibility..................................... 231 13.8 IPv6 Network Prefix Translation (NPt)................................. 234 13.9 Troubleshooting............................................. 236 13.10 Default NAT Configuration....................................... 239 14 Routing 241 14.1 Gateways................................................. 241 14.2 Gateway Settings............................................. 242 14.3 Gateway Groups............................................. 245 14.4 Static Routes............................................... 245 14.5 Routing Public IP Addresses....................................... 249 14.6 Routing Protocols............................................ 252 14.7 Route Troubleshooting.......................................... 254 15 Bridging 259 15.1 Creating a Bridge............................................. 259 15.2 Advanced Bridge Options........................................ 259 15.3 Bridging and Interfaces......................................... 262 15.4 Bridging and firewalling......................................... 264 15.5 Bridging Two Internal Networks..................................... 265 15.6 Bridging interoperability......................................... 266 15.7 Types of Bridges............................................. 267 15.8 Bridging and Layer 2 Loops....................................... 268 16 Virtual LANs (VLANs) 269 16.1 Terminology............................................... 269 16.2 VLANs and Security........................................... 270 16.3 pfSense VLAN Configuration...................................... 271 16.4 Switch VLAN Configuration....................................... 275 16.5 pfSense QinQ Configuration....................................... 285 16.6 Requirements............................................... 287 iii 17 Multiple WAN Connections 289 17.1 Multi-WAN Terminology and Concepts................................. 289 17.2 Policy Routing, Load Balancing and Failover Strategies........................ 291 17.3 Multi-WAN Caveats and Considerations................................. 292 17.4 Summary of Multi-WAN Requirements................................. 294 17.5 Load Balancing and Failover with Gateway Groups..........................