Pf

PF Basics

Basic Ruleset Full Connectifity v4/v6 allow SSH in from RFC1918 allow all outgoing # Backup cp /etc/pf.conf /etc/pf.conf.bak-$(date "+%s") # Paste new Ruleset cat << 'EOF' > /etc/pf.conf ####################################################################################################################### # # OpenBSD PF Template # ####################################################################################################################### ######################## ### DEFAULT SETTINGS ### ######################## set block-policy drop set limit states 100000 set limit table-entries 1000000 set optimization normal set ruleset-optimization none set skip on { lo0 enc0 } set syncookies adaptive (start 25%, end 12%) ######################## ### MACROS ### ######################## # log block lb = "log" # log pass lp = "log" ######################## ### NORMALIZATION ### ######################## match inet scrub (no-df max-mss 1380) match inet6 scrub (max-mss 1360) ######################## ### Block all / uRPF ### ######################## block log block in log quick from urpf-failed label uRPF ############################ ### DHCP & IPv6 Stuff ### ############################ # Allow DHCP pass $lp quick inet proto udp from any port 68 to 255.