ext_if="fxp0" int_if="fxp1" internal_net="192.168.1.0/24" nick="192.168.1.2" ssh_ports="22" im_ports="80" scrub in all altq on $ext_if cbq bandwidth 1Mb queue { std_out, ssh_im_out, dns_out, tcp_ack_out, nick_out } queue std_out cbq(default) queue ssh_im_out priority 4 queue dns_out priority 5 queue tcp_ack_out priority 6 queue nick_out bandwidth 80Kb cbq(borrow) altq on $int_if cbq bandwidth 6Mb queue { std_in, ssh_im_in, dns_in, nick_in } queue std_in bandwidth 3.5Mb cbq(default) queue ssh_im_in bandwidth 0.25Mb priority 4 queue dns_in bandwidth 0.25Mb priority 5 queue nick_in bandwidth 2.0Mb cbq(borrow) nat on $ext_if from $internal_net to any -> ($ext_if) rdr on $ext_if proto { tcp, udp } from any to any port 15060 -> 192.168.1.2 rdr on $ext_if proto { tcp, udp } from any to any port 55060 -> 192.168.1.2 rdr on $ext_if proto { tcp, udp } from any to any port 3389 -> 192.168.1.55 rdr on $ext_if proto { tcp, udp } from any to any port 21 -> 192.168.1.60 rdr on $ext_if proto { tcp, udp } from any to any port 10000 -> 192.168.1.60 block in on $ext_if all block out on $ext_if all pass out on $ext_if inet proto tcp from (fxp0) to any flags S/SA keep state queue(std_out, tcp_ack_out) pass out on $ext_if inet proto { udp icmp } from (fxp0) to any keep state pass out on $ext_if inet proto { tcp udp } from (fxp0) to any port domain keep state queue dns_out pass out on $ext_if inet proto tcp from (fxp0) to any port $ssh_ports flags S/SA keep state queue(std_out, ssh_im_out) pass out on $ext_if inet proto tcp from (fxp0) to any port $im_ports flags S/SA keep state queue(ssh_im_out, tcp_ack_out) pass out on $ext_if inet proto { tcp udp icmp } from $nick to any queue nick_out pass in on $ext_if proto { tcp, udp } from any to any port 15060 keep state pass in on $ext_if proto { tcp, udp } from any to any port 55060 keep state pass in on $ext_if proto { tcp, udp } from any to any port 3389 keep state pass in on $ext_if proto { tcp, udp } from any to any port 21 keep state pass in on $ext_if proto { tcp, udp } from any to any port 10000 keep state block in on $int_if all pass in on $int_if from $internal_net block out on $int_if all pass out on $int_if from any to $internal_net pass out on $int_if proto { tcp udp } from any port domain to $internal_net queue dns_in pass out on $int_if proto tcp from any port $ssh_ports to $internal_net queue(std_in, ssh_im_in) pass out on $int_if proto tcp from any port $im_ports to $internal_net queue ssh_im_in pass out on $int_if from any to $nick queue nick_in pass quick on lo0 all pass out on $ext_if proto { tcp, udp, icmp } all modulate state flags S/SA pass out on $ext_if proto { udp, icmp } all keep state pass in on $int_if from $internal_net to any