## PF setup NIC="fxp0" NICvpn="tun0" LAN="192.168.1.0/24" IP="192.168.1.15" set loginterface $NIC set skip on lo0 # Skip rules lo0 #rdr on $NICvpn proto tcp from any to any port 80 -> 192.168.1.14 port 3128 #rdr on lo0 proto udp from 127.0.0.1 to 127.0.0.1 port 53 -> 127.0.0.1 port 7777 # Block and log everything by default block log all block drop in quick on $NIC from any os { SCO, NMAP } block return-icmp out log on $NIC proto udp all block return-icmp in log on $NIC proto udp all # ------------------------------------------------------------------------------------------------ # WWW, psyBNC and SAMBA on Lan pass in on $NIC inet proto {tcp, udp} from $LAN to $NIC port { 139, 445 } keep state pass in on $NIC inet proto {tcp, udp} from any to any port { 31337 } keep state # WWW, FTP and SSH to the world. pass log (all) on $NIC inet proto tcp from any to any port { www, ssh, ftp } keep state pass log (all) on $NIC proto tcp from any to any port 60000:60001 keep state # Pass out TCP/UDP - Trust the inside of network. pass out on $NIC proto tcp all flags S/SA keep state pass out on $NIC proto udp all keep state # VPN pass quick on $NICvpn pass in on $NIC inet proto {udp} from any to ($NIC) port { 1194 } keep state queue vpn # -------------------------------------------------------------------------------------------------- # Squid #pass in on $NICvpn proto tcp from any to 192.168.1.14 port 3128 keep state #pass out on $NICvpn inet proto tcp from any to any port = www keep state #pass log (all) on $NIC inet proto tcp from any to any port { 3128 } keep state