#Modified on Aug 24 2010
int_if = "{ bge0 }"
ext_if = "{ bge1 }"
localip = "{ **censored** }"
wanip = "{ **censored** }"
dot7 = "{ **censored** }"
set skip on lo0
#set skip on gre0
#set timeout tcp.first 120
#set timeout tcp.established 86400
#set timeout { adaptive.start 6000, adaptive.end 12000 }
#set limit states 10000
set loginterface bge0
set loginterface bge1
set loginterface gre0
set optimization normal
set block-policy drop
scrub in on $ext_if all fragment reassemble
scrub in on $int_if all no-df random-id fragment reassemble
#UPLOAD SPEED
altq on $ext_if cbq bandwidth 4Mb queue { ou_std, ou_ack }
queue ou_ack bandwidth 10% priority 7 cbq(borrow red)
queue ou_std bandwidth 90% priority 5 cbq(default borrow red)
#DOWNLOAD SPEED
altq on $int_if cbq bandwidth 8Mb queue { in_std, in_ack, in_ssh }
queue in_ack bandwidth 10% priority 7 cbq(borrow red)
queue in_ssh bandwidth 5% priority 6 cbq(borrow red)
queue in_std bandwidth 85% cbq(default borrow red)
nat on $ext_if from **censored** to any -> **censored**
nat on $ext_if from 127.0.0.1 to any -> **censored**
no nat on lo0
no nat on $ext_if from $localip
no nat on $ext_if from $wanip
rdr on gre0 proto tcp from any to any port 80 -> 127.0.0.1 port 8080
block in log on $ext_if from any to any
block out log on $ext_if from any to any
block in on $ext_if from no-route to any
block in on $int_if from any to any
pass out on $ext_if inet proto icmp from any to any
pass out on $int_if inet proto icmp from any to any
pass out on $ext_if inet proto tcp from $wanip to any port ftp modulate state queue ( ou_std, ou_ack )
pass out on $ext_if inet proto tcp from $wanip to any port www modulate state queue ( ou_std, ou_ack )
pass out on $ext_if inet proto tcp from $wanip to any port > 1024 queue ( ou_std, ou_ack )
pass out on $ext_if inet proto tcp from $localip to any modulate state queue ( ou_std, ou_ack )
pass out on $ext_if inet proto udp from $localip to any keep state queue ( ou_std, ou_ack )
pass out on $ext_if inet proto tcp from any to any port ssh modulate state queue ( ou_std, ou_ack )
pass quick on $int_if inet proto udp from any to any port domain keep state
pass quick on $int_if inet proto udp from any to any port ntp keep state
pass quick on $int_if inet proto udp from any to any port 2048 keep state queue ( in_std, in_ack )
pass quick on $int_if inet proto gre from any to any queue ( in_std, in_ack )
pass in quick on $int_if inet proto tcp from $dot7 to $localip port ssh modulate state queue ( in_ssh, in_ack )
pass in quick on $int_if inet proto tcp from $dot7 to $localip port 667 modulate state queue ( in_std, in_ack )
pass in quick on $int_if inet proto tcp from any to any port www modulate state queue ( in_std, in_ack )
pass in quick on $int_if inet proto tcp from any to any port 3128 modulate state queue ( in_std, in_ack )
pass in quick on $int_if inet proto tcp from any to any port 8080 modulate state queue ( in_std, in_ack )
pass in quick on gre0 inet proto tcp from $dot7 to $localip port ssh modulate state queue ( in_ssh, in_ack )
pass in quick on gre0 inet proto tcp from any to any port www modulate state queue ( in_std, in_ack )
pass in quick on gre0 inet proto tcp from any to any port 3128 modulate state queue ( in_std, in_ack )
pass in quick on gre0 inet proto tcp from any to any port 8080 modulate state queue ( in_std, in_ack )
pass in quick on gre0 inet proto tcp from any to any port >1024 modulate state queue ( in_std, in_ack )
pass in quick log proto gre from any to any queue ( in_std, in_ack )
#pass all from ASA to BSD
pass in quick log on gre0 from **censored** to any modulate state
pass in quick log on $int_if from **censored** to any modulate state
pass in quick log on gre0 from **censored** to any modulate state
pass in quick log on $int_if from **censored** to any modulate state
pass in quick on $int_if inet proto tcp from any to any port >1024 modulate state queue ( in_std, in_ack )