# PF configuration for Central de Vendas Informatica LTDA. # admin@centralinf.com.br ### macros ### ext_if_ip = "201.12.35.51" ext_if = "re0" int_if = "xl0" int_odin = "192.168.1.134" ext_odin = "201.12.35.52" int_saint = "192.168.1.53" ext_saint = "201.12.35.54" range_saint = "200.230.207.0/24" table { 192.168.1.120, 192.168.1.121, 192.168.1.122, 192.168.1.123 } ### options ### set loginterface $ext_if set skip on lo ### scrub ### scrub all no-df fragment reassemble random-id ### nat ### # nat for all network. nat on $ext_if from $int_if:network to any -> $ext_if:0 nat-anchor "ftp-proxy/*" # binat for odin. binat on $ext_if from $int_odin to any -> $ext_odin # binat for saint. binat on $ext_if from $int_saint to $range_saint -> $ext_saint ### redirects ### # ftp-proxy. rdr-anchor "ftp-proxy/*" rdr pass on $int_if proto tcp to port ftp -> 127.0.0.1 port 8021 # transparent proxy. rdr on $int_if proto tcp from any to any port http -> 127.0.0.1 port 3128 ### filter rules ### # block everything. block log all # antispoof and ftp-proxy anchor. antispoof for $int_if inet anchor "ftp-proxy/*" # allow all traffic on $int_if. pass quick on $int_if # block msn. block inet proto tcp from any to any port 1863 # allow msn to priv_users ;). pass out on $ext_if inet proto tcp from to any \ port 1863 modulate state flags S/SA # allow ping. pass in quick inet proto icmp all icmp-type echoreq keep state # allow vpn (pptp) and tun interfaces. pass in quick on $ext_if inet proto tcp from any to $ext_if_ip \ port pptp modulate state flags S/SA pass in quick on $ext_if inet proto gre from any to $ext_if_ip \ keep state pass quick on tun # allow dns. pass in quick on $ext_if inet proto udp from any to $ext_if_ip \ port domain keep state # allow ftp and http to odin. pass in quick on $ext_if inet proto tcp from any to $int_odin \ port { ftp, ftp-data } modulate state flags S/SA pass in quick on $ext_if inet proto tcp from any to $int_odin \ port http modulate state flags S/SA pass in quick on $ext_if inet proto tcp from any to $int_odin port > 49151 \ modulate state flags S/SA # allow all tcp, udp and icmp pass out. pass out quick on $ext_if inet proto tcp all modulate state flags S/SA pass out quick on $ext_if inet proto { udp, icmp } all keep state