Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # pre-OpenBSD 4.7
- #
- # cat /usr/src/UPDATING | grep OpenBSD
- #
- # https://www.freebsd.org/doc/handbook/firewalls-pf.html
- # http://www.undeadly.org/cgi?action=article&sid=20060927091645
- # https://calomel.org/pf_config.html
- # https://calomel.org/pf_hfsc.html
- # http://dant.net.ru/calomel/pf_config.html
- # http://microsux.dk/?p=321
- # https://ackspace.nl/wiki/OpenBSD_Firewall_/_PF
- # http://prefetch.net/articles/monitoringpf.html
- # http://www.skeptech.org/blog/2013/01/15/pf-limits-in-openbsd
- # https://www.packetmischief.ca/2011/02/17/hitting-the-pf-state-table-limit
- #
- # PF understands rules using port names equally well as it does port numbers.
- # The names are the ones listed in /etc/services.
- # http://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml
- # http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
- # http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml
- #-------------------------------------------------------------------------------
- # (1) PF: List and Macros
- #-------------------------------------------------------------------------------
- # Interfaces
- ext_if = "bge0" # macro for external interface - use tun0 for PPPoE
- int_if = "bge1" # macro for internal interface
- dmz_if = "bge2" # macro for dmz interface
- vpn_if = "tap0" # macro for OpenVPN interface
- # External IP address
- ext_ipv4 = "181.143.123.123"
- ext_ipv6 = "2800:e7:a8:6123::4"
- # Internet Control Message Protocol (ICMP) Parameters
- # http://www.iana.org/assignments/icmp-parameters/icmp-parameters.xhtml
- icmp_types = "{ 0, 3, 8, 11, 12 }"
- #
- # Internet Control Message Protocol version 6 (ICMPv6) Parameters
- # http://www.iana.org/assignments/icmpv6-parameters/icmpv6-parameters.xhtml
- icmp6_types = "{ 1, 3, 4, 128, 133, 134, 135, 136 }"
- # External Ports
- ext_ports_tcp = "{ ssh, ntp, 9001, 9030, 9091 }"
- ext_ports_udp = "{ ntp, openvpn }"
- # Internal Ports
- int_ports_tcp = "{ domain, bootps, dhcpv6-server, ntp, http, https, http-alt, \
- smtp, smtps, pop3, pop3s, imap, imaps, ftp-data, ftp, ssh, cvsup, svn, \
- 3128, 3129, 3130, 9050, 8118, 8056, 2199, 8191, 82, 2087, 8081, 8333, 1157, \
- 2083, 8030, 9091, 10443, 3389, 8080, 81, 8086, 8000, 465, 587, 8444, \
- 9447, 7005, 115, 8030, 444, 2222, 2096, 8040, 2082, 8289, 3000, 8050, \
- 8051, 27643, 21234, 2086, 82, 8443, 4443, 7000, 8070, 8050, 9070 \
- 18080:18095, 8111, 34878, 93, 182, 8091, 8543, 18255, 2880, 8888, 33, \
- 13101, 9876, 9000, 8501, 8100, 2091, 2048, 2128, 2061, 2158, 2129, 2154, \
- 9443, 6969, 2969, 2139, 2460 }"
- int_ports_udp = "{ domain, bootps, dhcpv6-server, ntp, openvpn, svn, sip, snmp\
- 8056, 500, 1000, 1000, 8289, 8291, 9000 }"
- # NFS Server https://forums.freebsd.org/threads/5123
- nfs_tcp = "{ sunrpc, nfsd-status, nfsd, lockd, mdc-portmapper, cryptoadmin }"
- nfs_udp = "{ sunrpc, nfsd-keepalive, nfsd, lockd, mdc-portmapper, cryptoadmin }"
- # FTP Ports
- ftp_ports_tcp = "{ ftp, 2134, 9070 }"
- # Sony Anycast
- sonyanycast_tcp = "1935"
- # ShoutCast
- shoutcast_tcp = "9306"
- # Wowza https://www.wowza.com/resources/WowzaStreamingEngine_UsersGuide.pdf
- #wowza = "1935"
- # Real-Time Messaging Protocol https://en.wikipedia.org/wiki/Real-Time_Messaging_Protocol
- rtmp = "1935"
- # Comrex ACCESS Rack & Portable 2USB http://www.comrex.com/wp-content/uploads/2015/11/4.0-ACCESS-Addendum.pdf
- comrex_tcp = "{ 8080, 80, 8082, 8090 }"
- comrex_udp = "{ 9000, 9001 }"
- # Centova Cast http://www.centova.com/en/faq/cast3/information/configuring_a_firewall_for_centova_cast
- centovacast_tcp = "{ 2199, 2197, 21, 80, 8000:10000 }"
- centovacast_server = "62.210.203.78"
- # Application Manager and Avid License Control http://avid.force.com/pkb/articles/en_US/troubleshooting/en436075
- avidapplicationmanager_tcp = "{ 3443, 443, 96 }"
- # AviWest http://www.aviwest.com/wp-content/uploads/2016/02/DMNG_StreamHub_Installation_Guide_EN_v4.pdf
- aviwest_tcp = "8888"
- aviwest_udp = "{ 7900:7904 }"
- # Teradek Cube 655 https://support.teradek.com/hc/en-us/articles/225690067-What-network-ports-are-needed-for-streaming-with-Live-Air-and-Live-Air-Solo-
- teradek_host = "{ 172.16.8.70, 172.16.8.71, 172.16.8.72, 172.16.8.92, 172.16.16.66 }"
- teradek_tcp = "{ 1935, 80, 2543, 443, 6667 }"
- teradek_udp = "{ 53, 5353, 554, 49513:65535, 21572 }"
- # Datavideo NVS-25
- datavideo_host = "172.16.16.68"
- datavideo_tcp = "{ 1935, 80, 2543, 443, 6667, 8554, 8000, 8080, 554 }"
- datavideo_udp = "{ 1935, 53, 5353, 554, 49513:65535, 21572, 8554 }"
- # LiveU2000 (no esta funcionando las reglas)
- #liveu_host = "172.16.16.23"
- #liveu_tcp = "{ 53, 80, 443, 10020, 8400:8600, 1935, 18255, 8543, 8601:8608, 873, 1873, 22222, 5938, 8000:8007, 9000:9007, 7775, 1945, 18265 }"
- #liveu_udp = "{ 53, 8601:8608, 8609:8615, 8620:8667, 8000:8007, 9100:9109, 9110, 9101, 9000:9007, 9008:9011, 9104:9107 }"
- # Ofimatica
- # Ofimatica http://www.ofimanet.com/OfimaBotInstaladores/OfimaBotEnterprise.pdf
- # ftp user:[email protected]:9070
- # OfimaWEB
- ofimaweb_host = "172.16.3.3"
- ofimaweb_tcp = "46046"
- # P2P (firewall and P2P in same computer)
- #
- # Transmission Port: /usr/ports/net-p2p/transmission-daemon
- # Transmission (tcp 51413 defaul or tcp/udp range 49152:65535)
- rpc_port_tcp = "9091" # Control web http://<ipserver>:9091
- peer_port_tcp = "51413"
- peer_port_range = "{ 49152:65535 }"
- #
- # P2P (P2P in another computer)
- #
- # eMule
- # (Server List http://emuling.net23.net/server.met Update)
- # (KAD: http://www.emule-mods.it/download/nodes.dat Bootstrap)
- emule_client = "172.16.50.3"
- emule_tcp = "4662"
- emule_udp = "{ 4665, 4672, 65535 }"
- # VoIP Calls APP
- #
- # Asterisk
- asterisk_udp = "{ 5060, 10000:20000 }"
- #
- # Google Hangouts -> https://support.google.com/a/answer/1279090?hl=en
- hangouts_tcp = "{ 19305:19309 }"
- hangouts_udp = "{ 19302:19309 }"
- #
- # Viber -> http://www.viberfaq.com/why-cant-i-use-viber-on-some-wi-fi-networks
- viber_tcp = "{ 5242, 4244 }"
- viber_udp = "{ 5243, 9785 }"
- #
- # Line
- # LINE's system uses ports 80 and 443 of the TCP service.
- # LINE Free Call UDP 389, 443, 554, 9400:9420, 10000:60000
- # LINE Premium Call (paid service) UDP 10000:60000
- # el ultimo rango no lo puedo abrir al ser muchos puertos
- line_tcp = "{ 80, 443 }"
- line_udp = "{ 389, 443, 554, 9400:9420 }"
- #
- # https://www.quora.com/What-is-the-port-number-for-whatsapp
- whatsapp_tcp = "{ 4244, 5222, 5223, 5228, 5242, 50318, 59234 }"
- #whatsapp_udp = "{ 34784, 45395, 50318, 59234, 40000:60000 }" # El rango es muy grande
- whatsapp_udp = "{ 34784, 45395, 50318, 59234, 40000:40020 }" # Abro solo 20 puertos
- #
- # Panasonic -> http://ict3.com/Data/KX-TDE200/IP_Networking_Guide.pdf
- #panasonic_tcp = "{ }"
- #panasonic_udp = "{ 9300, 2727, 8000:8063 }"
- #
- # Instant Talk Mobile Tornado
- instanttalk_tcp = "{ 8081, 26000, 843, 8082, 26001, 843 }"
- instanttalk_udp = "{ 25000, 25001 }"
- #
- # Vidyo (VidyoConferencing Firewall Ports) -> http://www.vidyo.com/wp-content/uploads/VidyoConferencing_Admin_Guide_2.3-B.pdf
- vidyo_tcp = "{ 80, 443, 17992, 17990 }"
- vidyo_udp = "{ 50000:65535 }"
- #
- # FaceTime https://support.apple.com/en-us/HT202078
- facetime_tcp = "{ 80, 443, 5223 }"
- facetime_udp = "{ 3478:3497, 16384:16387, 16394:16402 }"
- #
- # iMessage
- imessage_tcp = "{ 80, 443, 5223 }"
- # Samba service
- smb_tcp = "{ loc-srv, netbios-ssn, swat, microsoft-ds }"
- smb_udp = "{ netbios-ns, netbios-dgm }"
- # HostGator http://support.hostgator.com/articles/specialized-help/technical/commonly-used-port-numbers
- hostgator_tcp = "{ 2082, 2083, 2086, 2087, 2095, 2096, \
- 110, 995, 143, 993, 25, 26, 587, 465, \
- 80, 443, 21, 990, 22, 2222, 2077, 2078, 3306, 1433, 22, 2222, \
- 8880, 8443, 9998, 4643, 9001, 80, 4489, 5100 }"
- # Cisco VPN Client
- ciscovpn_tcp = "10000"
- ciscovpn_udp = "{ 500, 4500, 10000 }"
- # Squid-cache test
- # Carlos Giovani Sergio Miguel
- #squid_ipv4 = "{ 172.16.8.4, 172.16.51.12, 172.16.51.70, 172.16.2.2 }"
- squid_ipv4 = "{ 172.16.2.2 }"
- #squid_ipv6 = "{ fc00::8:4, fc00::2000, fc00::18f4, fc00::2:2 }"
- squid_ipv6 = "{ fc00::2:2 }"
- # EMG-12 S/N: M1232 05 Thernet Modbus Gateway
- emg12_host = "172.16.23.100"
- emg12_tcp = "2001"
- # Datafono
- datafono_tcp = "{ 443, 8080 }"
- # Turibus
- turibus_tcp = "{ 60391, 1433, 30074 }"
- #-------------------------------------------------------------------------------
- # (2) PF: Tables
- #-------------------------------------------------------------------------------
- # IPv4 RFCs
- table <rfc1918> { 192.168.0.0/16, 172.16.0.0/12, 10.0.0.0/8 }
- table <rfc3927> { 169.254.0.0/16 }
- table <rfc5735> { 192.0.2.0/24 }
- table <rfc3330> { 0.0.0.0/8 }
- table <rfc6890> { 240.0.0.0/4 }
- # IPv6 RFCs
- table <rfc4193> { fc00::/7 }
- # Examples
- #table <clients> { 192.168.2.0/24, !192.168.2.5 }
- #table <clients> persist file "/etc/clients"
- # Blocklists
- table <blocklist1>
- table <blocklist2>
- table <blocklist3>
- # TOR list
- table <torlist>
- # Example for /etc/crontab
- #
- # Bocklist1
- #00 05 * * * root /usr/bin/fetch -o /tmp/blocklist1.txt https://lists.blocklist.de/lists/all.txt >/dev/null 2>&
- #10 05 * * * root /sbin/pfctl -t blocklist1 -T replace -f /tmp/blocklist1.txt >/dev/null 2>&1
- #-------------------------------------------------------------------------------
- # (3) PF: Options
- #-------------------------------------------------------------------------------
- # Misc Options
- set skip on lo
- set debug urgent
- set block-policy drop
- set loginterface $ext_if
- set state-policy if-bound
- set fingerprints "/etc/pf.os"
- set ruleset-optimization basic
- set optimization normal
- set limit { states 1000000, frags 1000000, src-nodes 100000, table-entries 1000000 }
- #-------------------------------------------------------------------------------
- # (4) PF: Packet Queueing and Priorization
- #-------------------------------------------------------------------------------
- # No ALTQ support in GENERIC kernel, Build a Custom Kernel and Enabling ALTQ
- # ISP Upload = 60Mb/s (queue at 97%)
- altq on $ext_if bandwidth 58.20Mb hfsc queue { ack1, dns1, ssh1, web1, mail1, bulk1, bittor1, spamd1 }
- queue ack1 bandwidth 30% qlimit 500 hfsc (realtime 20%)
- queue dns1 bandwidth 5% qlimit 500 hfsc (realtime 5%)
- queue ssh1 bandwidth 20% qlimit 500 hfsc (realtime 20%) {ssh1_login1, ssh1_bulk1}
- queue ssh1_login1 bandwidth 50% qlimit 500 hfsc
- queue ssh1_bulk1 bandwidth 50% qlimit 500 hfsc
- queue bulk1 bandwidth 20% qlimit 500 hfsc (realtime 20% default, ecn)
- queue web1 bandwidth 5% qlimit 500 hfsc (realtime (10%, 10000, 5%))
- queue mail1 bandwidth 5% qlimit 500 hfsc (realtime 5%)
- queue bittor1 bandwidth 1% qlimit 500 hfsc (upperlimit 95%)
- queue spamd1 bandwidth 1% qlimit 500 hfsc (upperlimit 1Kb)
- # ISP Download = 120Mb/s (queue at 97%)
- altq on $int_if bandwidth 116.40Mb hfsc queue { ack2, dns2, ssh2, web2, mail2, bulk2, bittor2, spamd2 }
- queue ack2 bandwidth 30% qlimit 500 hfsc (realtime 20%)
- queue dns2 bandwidth 5% qlimit 500 hfsc (realtime 5%)
- queue ssh2 bandwidth 20% qlimit 500 hfsc (realtime 20%) {ssh2_login2, ssh2_bulk2}
- queue ssh2_login2 bandwidth 50% qlimit 500 hfsc
- queue ssh2_bulk2 bandwidth 50% qlimit 500 hfsc
- queue bulk2 bandwidth 20% qlimit 500 hfsc (realtime 20% default, ecn)
- queue web2 bandwidth 5% qlimit 500 hfsc (realtime (10%, 10000, 5%))
- queue mail2 bandwidth 5% qlimit 500 hfsc (realtime 5%)
- queue bittor2 bandwidth 1% qlimit 500 hfsc (upperlimit 95%)
- queue spamd2 bandwidth 1% qlimit 500 hfsc (upperlimit 1Kb)
- #-------------------------------------------------------------------------------
- # (5) PF: Netkwork Address Translation (NAT) and Packet Redirection
- #-------------------------------------------------------------------------------
- # No nat for this IP
- #no nat on $ext_if inet from 172.16.52.198 to any
- #no nat on $ext_if inet6 from fc00::1128 to any
- # Internet (NAT IPv4 = yes | NAT IPv6 = yes)
- nat on $ext_if inet from any to any -> $ext_ipv4
- nat on $ext_if inet6 from any to any -> $ext_ipv6
- # OpenVPN
- nat on $vpn_if inet from any to any -> ($vpn_if:0)
- nat on $vpn_if inet6 from any to any -> ($vpn_if:0)
- # FTP-Proxy
- nat-anchor "ftp-proxy/*"
- rdr-anchor "ftp-proxy/*"
- # Redirect FTP traffic to proxy (ftp-proxy)
- rdr pass on $int_if inet proto tcp from any to any port $ftp_ports_tcp -> 127.0.0.1 port ftp-proxy
- rdr pass on $int_if inet6 proto tcp from any to any port $ftp_ports_tcp -> ::1 port ftp-proxy
- #=================== SQUID =====================================
- # Intercept HTTPS CONNECT messages with SSL-Bump
- #rdr pass on $int_if inet proto tcp from any to any port https -> 172.16.1.1 port 3130
- #rdr pass on $int_if inet6 proto tcp from any to any port https -> fc00::1:1 port 3130
- #rdr pass on $int_if inet proto tcp from $squid_ipv4 to any port https -> 172.16.1.1 port 3130
- #rdr pass on $int_if inet6 proto tcp from $squid_ipv6 to any port https -> fc00::1:1 port 3130
- #=================== SQUID =====================================
- # DC SSH (ssh [email protected] -p 2222)
- rdr pass on $ext_if inet proto tcp from any to port 2222 -> 172.16.3.1 port 22
- rdr pass on $ext_if inet6 proto tcp from any to port 2222 -> fc00::3:1 port 22
- # NS1 SSH
- rdr pass on $ext_if inet proto tcp from any to port 2223 -> 172.16.2.1 port 22
- rdr pass on $ext_if inet6 proto tcp from any to port 2223 -> fc00::2:1 port 22
- # NS2 SSH
- rdr pass on $ext_if inet proto tcp from any to port 2224 -> 172.16.2.2 port 22
- rdr pass on $ext_if inet6 proto tcp from any to port 2224 -> fc00::2:2 port 22
- # Servidor temporal
- rdr pass on $ext_if inet proto tcp from any to port 2225 -> 172.16.3.111 port 22
- rdr pass on $ext_if inet6 proto tcp from any to port 2225 -> fc00::3:111 port 22
- # DC HTTP
- rdr pass on $ext_if inet proto tcp from any to port http -> 172.16.3.1 port http
- rdr pass on $ext_if inet6 proto tcp from any to port http -> fc00::3:1 port http
- # DC HTTPS
- rdr pass on $ext_if inet proto tcp from any to port https -> 172.16.3.1 port https
- rdr pass on $ext_if inet6 proto tcp from any to port https -> fc00::3:1 port https
- # DC PostgreSQL
- rdr pass on $ext_if inet proto tcp from any to port postgresql -> 172.16.3.1 port postgresql
- rdr pass on $ext_if inet6 proto tcp from any to port postgresql -> fc00::3:1 port postgresql
- # UPS APC
- rdr pass on $ext_if inet proto tcp from any to port 81 -> 172.16.22.1 port 80
- # UPS ALPHA
- rdr pass on $ext_if inet proto tcp from any to port 82 -> 172.16.22.2 port 80
- # UPS Emerson
- rdr pass on $ext_if inet proto tcp from any to port 83 -> 172.16.22.3 port 80
- # AIRE Jhonson Controller
- rdr pass on $ext_if inet proto tcp from any to port 85 -> 172.16.18.1 port 80
- # Receptor Tandberg RX8200
- #rdr pass on $ext_if inet proto tcp from any to port 86 -> 172.16.16.65 port 80
- # Receptor Tandberg RX8200
- #rdr pass on $ext_if inet proto tcp from any to port 87 -> 172.16.16.64 port 80
- # Matrox Monarch MGX1920 S/N: BP81698
- rdr pass on $ext_if inet proto tcp from any to port 88 -> 172.16.16.66 port 80
- # Data Video
- rdr pass on $ext_if inet proto tcp from any to port 89 -> 172.16.16.68 port 80
- # Redireccion Escritorio Remoto Windows (FOXTROT)
- rdr pass on $ext_if inet proto tcp from any to port 3389 -> 172.16.3.3 port 3389
- # Redireccion Escritorio Remoto Windows (MXL7012PZ3)
- rdr pass on $ext_if inet proto tcp from any to port 3390 -> 172.16.8.32 port 3389
- # HP Compaq Pro 6300 SFF MXL2491K5M (Carlos Duque)
- rdr pass on $ext_if inet proto tcp from any to port 3391 -> 172.16.9.4 port 3389
- # HP Compaq Elite 8300 Convertible Microtower S/N: MXL3151M2M
- # Windows Remote Desktop
- rdr pass on $ext_if inet proto tcp from any to port 3392 -> 172.16.8.47 port 3389
- rdr pass on $ext_if inet6 proto tcp from any to port 3392 -> fc00::8:47 port 3389
- # RealVNC
- rdr pass on $ext_if inet proto tcp from any to port 5900 -> 172.16.8.47 port 5900
- rdr pass on $ext_if inet6 proto tcp from any to port 5900 -> fc00::8:47 port 5900
- # Clear-Com -> IVC32
- rdr pass on $ext_if inet proto { tcp, udp } from any to port 6001 -> 172.16.16.41 port 6001
- # ConcertPC -> ConcertServer (CentOS)
- rdr pass on $ext_if inet proto { tcp, udp } from any to port 6002 -> 172.16.16.47 port 6001
- # Panasonic KX-TDE200BX
- #rdr pass on $ext_if inet proto tcp from any to port $panasonic_udp -> 172.16.12.1
- # Control
- rdr pass on $ext_if inet proto tcp from any to port 554 -> 172.16.16.16 port 554
- # Link Electronics SCE-492 S/N: 171 (Closed Caption)
- rdr pass on $ext_if inet proto tcp from any to port 10001 -> 172.16.16.59
- # HP HP Compaq d220 MT S/N: MXD412067V
- rdr pass on $ext_if inet proto { tcp, udp } from any to port 5003 -> 172.16.8.48
- # Asterisk
- rdr pass on $ext_if inet proto udp from any to port $asterisk_udp -> 172.16.3.1
- rdr pass on $ext_if inet6 proto udp from any to port $asterisk_udp -> fc00::3:1
- # eMule
- rdr pass on $ext_if inet proto tcp from any to port $emule_tcp -> $emule_client
- rdr pass on $ext_if inet proto udp from any to port $emule_udp -> $emule_client
- # Liveu2000 (no esta funcionando las reglas)
- #rdr pass on $ext_if inet proto tcp from any to port $liveu_tcp -> $liveu_host
- #rdr pass on $ext_if inet proto udp from any to port $liveu_udp -> $liveu_host
- # OfimaWEB
- rdr pass on $ext_if inet proto tcp from any to port $ofimaweb_tcp -> $ofimaweb_host
- # EMG-12 S/N: M1232 05 Thernet Modbus Gateway
- rdr pass on $ext_if inet proto tcp from any to port $emg12_tcp -> $emg12_host
- #-------------------------------------------------------------------------------
- # (6) PF: Packet Filtering
- #-------------------------------------------------------------------------------
- # FTP-Proxy
- # We need to have an anchor for ftp-proxy
- anchor "ftp-proxy/*"
- # Blocking Spoofed Packets (Paquetes Falsificados)
- # https://home.nuug.no/~peter/pf/newest/antispoof.html
- antispoof for $ext_if
- antispoof for $int_if
- # Default block all
- block log all
- #-------------------------------------------------------------------------------
- # Filter rules for $ext_if inbound
- # Temporarily allow all, do not leave active!
- #pass in log on $ext_if inet proto tcp from any to any
- #pass in log on $ext_if inet6 proto tcp from any to any
- #pass in log on $ext_if inet proto udp from any to any
- #pass in log on $ext_if inet6 proto udp from any to any
- # SSH
- pass in log on $ext_if inet proto tcp from any to port ssh
- pass in log on $ext_if inet6 proto tcp from any to port ssh
- # Web
- pass in log on $ext_if inet proto tcp from any to any port { http, https }
- pass in log on $ext_if inet6 proto tcp from any to any port { http, https }
- # External Ports
- pass in log on $ext_if inet proto tcp from any to any port $ext_ports_tcp
- pass in log on $ext_if inet6 proto tcp from any to any port $ext_ports_tcp
- pass in log on $ext_if inet proto udp from any to any port $ext_ports_udp
- pass in log on $ext_if inet6 proto udp from any to any port $ext_ports_udp
- # Allow in the default range for traceroute(8)
- # "base+nhops*nqueries-1" (33434+64*3-1)
- pass in log on $ext_if inet proto udp from any to any port 33434:33625
- pass in log on $ext_if inet6 proto udp from any to any port 33434:33625
- # Allow in ICMP Traffic
- pass in log quick on $ext_if inet proto icmp icmp-type $icmp_types
- pass in log quick on $ext_if inet6 proto icmp6 icmp6-type $icmp6_types
- # IPv4 RFCs
- block drop in log quick on $ext_if inet from { <rfc1918>, <rfc3927>, <rfc5735>, <rfc3330>, <rfc6890> }
- # IPv6 RFCs
- block drop in log quick on $ext_if inet6 from { <rfc4193> }
- # Examples
- #pass in log on $ext_if inet from { <clients> }
- # Blocklists
- block drop in log quick on $ext_if inet from { <blocklist1>, <blocklist2>, <blocklist3> }
- block drop in log quick on $ext_if inet6 from { <blocklist1>, <blocklist2>, <blocklist3> }
- # TOR list
- #block drop in log quick on $ext_if inet from <torlist>
- #block drop in log quick on $ext_if inet6 from <torlist>
- #-------------------------------------------------------------------------------
- # Filter rules for $ext_if outbound
- # Server out to all # Upload (1)
- pass out log on $ext_if inet proto tcp from ($ext_if) to any queue (bulk1, ack1)
- pass out log on $ext_if inet6 proto tcp from ($ext_if) to any queue (bulk1, ack1)
- pass out log on $ext_if inet proto udp from ($ext_if) to any queue (bulk1, ack1)
- pass out log on $ext_if inet6 proto udp from ($ext_if) to any queue (bulk1, ack1)
- # SSH
- pass out log on $ext_if inet proto tcp from ($ext_if) to any port ssh queue (ssh1_bulk1, ssh1_login1)
- pass out log on $ext_if inet6 proto tcp from ($ext_if) to any port ssh queue (ssh1_bulk1, ssh1_login1)
- # Web
- pass out log on $ext_if inet proto tcp from ($ext_if) to any port { http, https } queue (web1, ack1)
- pass out log on $ext_if inet6 proto tcp from ($ext_if) to any port { http, https } queue (web1, ack1)
- # Mail
- pass out log on $ext_if inet proto tcp from ($ext_if) to any port { smtp, smtps, pop3, pop3s, imap, imaps, 465, 587 } queue (mail1, ack1)
- pass out log on $ext_if inet6 proto tcp from ($ext_if) to any port { smtp, smtps, pop3, pop3s, imap, imaps, 465, 587 } queue (mail1, ack1)
- # DNS
- pass out log on $ext_if inet proto udp from ($ext_if) to any port domain queue (dns1, ack1)
- pass out log on $ext_if inet6 proto udp from ($ext_if) to any port domain queue (dns1, ack1)
- # All other UDP
- pass out log on $ext_if inet proto udp from ($ext_if) to any queue (bulk1, ack1)
- pass out log on $ext_if inet6 proto udp from ($ext_if) to any queue (bulk1, ack1)
- # Allow in the default range for traceroute(8)
- # "base+nhops*nqueries-1" (33434+64*3-1)
- pass out log on $ext_if inet proto udp from ($ext_if) to any port 33434:33625 queue (ack1)
- pass out log on $ext_if inet6 proto udp from ($ext_if) to any port 33434:33625 queue (ack1)
- # Allow out ICMP Traffic
- pass out log quick on $ext_if inet proto icmp icmp-type $icmp_types queue (ack1)
- pass out log quick on $ext_if inet6 proto icmp6 icmp6-type $icmp6_types queue (ack1)
- # IPv4 RFCs
- block drop out log quick on $ext_if inet from { <rfc1918>, <rfc3927>, <rfc5735>, <rfc3330>, <rfc6890> }
- # IPv6 RFCs
- block drop out log quick on $ext_if inet6 from { <rfc4193> }
- # Examples
- #pass out log on $ext_if inet from { <clients> }
- # Blocklists
- block drop out log quick on $ext_if inet from { <blocklist1>, <blocklist2>, <blocklist3> }
- block drop out log quick on $ext_if inet6 from { <blocklist1>, <blocklist2>, <blocklist3> }
- # TOR list
- #block drop out log quick on $ext_if inet from <torlist>
- #block drop out log quick on $ext_if inet6 from <torlist>
- #-------------------------------------------------------------------------------
- # Filter rules for $int_if inbound
- # Temporarily allow all, do not leave active!
- #pass in log on $int_if inet proto tcp from any to any
- #pass in log on $int_if inet6 proto tcp from any to any
- #pass in log on $int_if inet proto udp from any to any
- #pass in log on $int_if inet6 proto udp from any to any
- # Temporarily allow all to one computer
- pass in log on $int_if inet proto tcp from 172.16.12.214 to any
- #pass in log on $int_if inet6 proto tcp from fc00::1d8e to any
- pass in log on $int_if inet proto udp from 172.16.12.214 to any
- #pass in log on $int_if inet6 proto udp from fc00::1d8e to any
- # Internal Ports
- pass in log on $int_if inet proto tcp from any to any port $int_ports_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $int_ports_tcp
- pass in log on $int_if inet proto udp from any to any port $int_ports_udp
- pass in log on $int_if inet6 proto udp from any to any port $int_ports_udp
- # Allow in the default range for traceroute(8)
- # "base+nhops*nqueries-1" (33434+64*3-1)
- pass in log on $int_if inet proto udp from any to any port 33434:33625
- pass in log on $int_if inet6 proto udp from any to any port 33434:33625
- # VoIP Calls APP
- #
- # Google Hangouts
- pass in log on $int_if inet proto tcp from any to any port $hangouts_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $hangouts_tcp
- pass in log on $int_if inet proto udp from any to any port $hangouts_udp
- pass in log on $int_if inet6 proto udp from any to any port $hangouts_udp
- #
- # Viber
- #pass in log on $int_if inet proto tcp from any to any port $viber_tcp
- #pass in log on $int_if inet6 proto tcp from any to any port $viber_tcp
- #pass in log on $int_if inet proto udp from any to any port $viber_udp
- #pass in log on $int_if inet6 proto udp from any to any port $viber_udp
- #
- # Line
- #pass in log on $int_if inet proto tcp from any to any port $line_tcp
- #pass in log on $int_if inet6 proto tcp from any to any port $line_tcp
- #pass in log on $int_if inet proto udp from any to any port $line_udp
- #pass in log on $int_if inet6 proto udp from any to any port $line_udp
- #
- # WhatsApp
- pass in log on $int_if inet proto tcp from any to any port $whatsapp_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $whatsapp_tcp
- pass in log on $int_if inet proto udp from any to any port $whatsapp_udp
- pass in log on $int_if inet6 proto udp from any to any port $whatsapp_udp
- #
- # Instant Talk Mobile Tornado
- #pass in log on $int_if inet proto tcp from any to any port $instanttalk_tcp
- #pass in log on $int_if inet6 proto tcp from any to any port $instanttalk_tcp
- #pass in log on $int_if inet proto udp from any to any port $instanttalk_udp
- #pass in log on $int_if inet6 proto udp from any to any port $instanttalk_udp
- #
- # Vidyo
- #pass in log on $int_if inet proto tcp from any to any port $vidyo_tcp
- #pass in log on $int_if inet6 proto tcp from any to any port $vidyo_tcp
- #pass in log on $int_if inet proto udp from any to any port $vidyo_udp
- #pass in log on $int_if inet6 proto udp from any to any port $vidyo_udp
- #
- # FaceTime
- pass in log on $int_if inet proto tcp from any to any port $facetime_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $facetime_tcp
- pass in log on $int_if inet proto udp from any to any port $facetime_udp
- pass in log on $int_if inet6 proto udp from any to any port $facetime_udp
- #
- # iMessage
- pass in log on $int_if inet proto tcp from any to any port $imessage_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $imessage_tcp
- # SAMBA from LAN
- pass in log on $int_if inet proto tcp from any to any port $smb_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $smb_tcp
- pass in log on $int_if inet proto udp from any to any port $smb_udp
- pass in log on $int_if inet6 proto udp from any to any port $smb_udp
- # HostGator
- pass in log on $int_if inet proto tcp from any to any port $hostgator_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $hostgator_tcp
- # Cisco VPN Client
- pass in log on $int_if inet proto tcp from any to any port $ciscovpn_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $ciscovpn_tcp
- pass in log on $int_if inet proto udp from any to any port $ciscovpn_udp
- pass in log on $int_if inet6 proto udp from any to any port $ciscovpn_udp
- # NFS
- pass in log on $int_if inet proto tcp from any to any port $nfs_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $nfs_tcp
- pass in log on $int_if inet proto udp from any to any port $nfs_udp
- pass in log on $int_if inet6 proto udp from any to any port $nfs_udp
- # Sony Anycast
- pass in log on $int_if inet proto tcp from any to any port $sonyanycast_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $sonyanycast_tcp
- # ShoutCast
- pass in log on $int_if inet proto tcp from any to any port $shoutcast_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $shoutcast_tcp
- # Wowza
- #pass in log on $int_if inet proto tcp from any to any port $wowza
- #pass in log on $int_if inet6 proto tcp from any to any port $wowza
- # Real-Time Messaging Protocol
- pass in log on $int_if inet proto tcp from any to any port $rtmp
- pass in log on $int_if inet6 proto tcp from any to any port $rtmp
- # Comrex ACCESS Rack & Portable 2USB
- pass in log on $int_if inet proto tcp from any to any port $comrex_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $comrex_tcp
- pass in log on $int_if inet proto udp from any to any port $comrex_udp
- pass in log on $int_if inet6 proto udp from any to any port $comrex_udp
- # Centova Cast
- pass in log on $int_if inet proto tcp from any to $centovacast_server port $centovacast_tcp
- # Application Manager and Avid License Control
- pass in log on $int_if inet proto tcp from any to any port $avidapplicationmanager_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $avidapplicationmanager_tcp
- # Aviwest
- pass in log on $int_if inet proto tcp from any to any port $aviwest_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $aviwest_tcp
- pass in log on $int_if inet proto udp from any to any port $aviwest_udp
- pass in log on $int_if inet6 proto udp from any to any port $aviwest_udp
- # Teradek Cube 655
- pass in log on $int_if inet proto tcp from $teradek_host to any port $teradek_tcp
- pass in log on $int_if inet proto udp from $teradek_host to any port $teradek_udp
- # Datavideo NVS-25
- pass in log on $int_if inet proto tcp from $datavideo_host to any port $datavideo_tcp
- pass in log on $int_if inet proto udp from $datavideo_host to any port $datavideo_udp
- # LiveU2000 (no esta funcionando las reglas)
- #pass in log on $int_if inet proto tcp from $liveu_host to any port $liveu_tcp
- #pass in log on $int_if inet proto udp from $liveu_host to any port $liveu_udp
- # OfimaWEB
- pass in log on $int_if inet proto tcp from $ofimaweb_host to any port $ofimaweb_tcp
- # EMG-12 S/N: M1232 05 Thernet Modbus Gateway
- pass in log on $int_if inet proto tcp from $emg12_host to any port $emg12_tcp
- # Datafono
- pass in log on $int_if inet proto tcp from any to any port $datafono_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $datafono_tcp
- # Turibus
- pass in log on $int_if inet proto tcp from any to any port $turibus_tcp
- pass in log on $int_if inet6 proto tcp from any to any port $turibus_tcp
- # Allow in ICMP Traffic
- pass in log quick on $int_if inet proto icmp icmp-type $icmp_types
- pass in log quick on $int_if inet6 proto icmp6 icmp6-type $icmp6_types
- #-------------------------------------------------------------------------------
- # Filter rules for $int_if outbound
- # Server out to all # Download (2)
- pass out log on $int_if inet proto tcp from any to any queue (bulk2, ack2)
- pass out log on $int_if inet6 proto tcp from any to any queue (bulk2, ack2)
- pass out log on $int_if inet proto udp from any to any queue (bulk2, ack2)
- pass out log on $int_if inet6 proto udp from any to any queue (bulk2, ack2)
- # SSH
- pass out log on $int_if inet proto tcp from any to any port ssh queue (ssh2_bulk2, ssh2_login2)
- pass out log on $int_if inet6 proto tcp from any to any port ssh queue (ssh2_bulk2, ssh2_login2)
- # Web
- pass out log on $int_if inet proto tcp from any to any port { http, https } queue (web2, ack2)
- pass out log on $int_if inet6 proto tcp from any to any port { http, https } queue (web2, ack2)
- # Mail
- pass out log on $int_if inet proto tcp from any to any port { smtp, smtps, pop3, pop3s, imap, imaps, 465, 587 } queue (mail2, ack2)
- pass out log on $int_if inet6 proto tcp from any to any port { smtp, smtps, pop3, pop3s, imap, imaps, 465, 587 } queue (mail2, ack2)
- # DNS
- pass out log on $int_if inet proto tcp from any to any port domain queue (dns2, ack2)
- pass out log on $int_if inet6 proto tcp from any to any port domain queue (dns2, ack2)
- # Allow in the default range for traceroute(8)
- # "base+nhops*nqueries-1" (33434+64*3-1)
- pass out log on $int_if inet proto udp from any to any port 33434:33625 queue (ack2)
- pass out log on $int_if inet6 proto udp from any to any port 33434:33625 queue (ack2)
- # Allow out ICMP Traffic
- pass out log quick on $int_if inet proto icmp icmp-type $icmp_types queue (ack2)
- pass out log quick on $int_if inet6 proto icmp6 icmp6-type $icmp6_types queue (ack2)
- #-------------------------------------------------------------------------------
- # Filter rules for $dmz_if inbound
- # Future rules here
- #-------------------------------------------------------------------------------
- # Filter rules for $int_if_dmz outbound
- # Future rules here
- #-------------------------------------------------------------------------------
- # Filter rules for $vpn_if inbound
- # Allow in all
- pass in log on $vpn_if inet proto tcp from any to any
- pass in log on $vpn_if inet6 proto tcp from any to any
- pass in log on $vpn_if inet proto udp from any to any
- pass in log on $vpn_if inet6 proto udp from any to any
- # Allow in ICMP Traffic
- pass in log quick on $vpn_if inet proto icmp icmp-type $icmp_types
- pass in log quick on $vpn_if inet6 proto icmp6 icmp6-type $icmp6_types
- #-------------------------------------------------------------------------------
- # Filter rules for $vpn_if outbound
- # Allow out all
- pass out log on $vpn_if inet proto tcp from any to any
- pass out log on $vpn_if inet6 proto tcp from any to any
- pass out log on $vpn_if inet proto udp from any to any
- pass out log on $vpn_if inet6 proto udp from any to any
- # Allow out ICMP Traffic
- pass out log quick on $vpn_if inet proto icmp icmp-type $icmp_types
- pass out log quick on $vpn_if inet6 proto icmp6 icmp6-type $icmp6_types
- #-------------------------------------------------------------------------------
Add Comment
Please, Sign In to add comment