Building the Network You Need with OpenBSD's PF: BSDCan, Ottawa May 6th, 2009
Prev |  | Next

# Queueing for a DMZ: rules part 1

    total_ext = 2Mb
    total_dmz = 100Mb
    altq on $ext_if cbq bandwidth $total_ext queue { ext_main, ext_web, \
            ext_udp, ext_mail, ext_ssh }
    queue ext_main bandwidth 25% cbq(default borrow red) { ext_hi, ext_lo }
         queue ext_hi priority 7 bandwidth 20%
         queue ext_lo priority 0 bandwidth 80%
    queue ext_web bandwidth 25% cbq(borrow red)
    queue ext_udp bandwidth 20% cbq(borrow red)
    queue ext_mail bandwidth 30% cbq(borrow red)
    altq on $dmz_if cbq bandwidth $total_dmz queue { ext_dmz, dmz_main, \
          dmz_web, dmz_udp, dmz_mail }
    queue ext_dmz bandwidth $total_ext cbq(borrow red) queue { ext_dmz_web, \
         ext_dmz_udp, ext_dmz_mail }
         queue ext_dmz_web bandwidth 40% priority 5
         queue ext_dmz_udp bandwidth 10% priority 7
         queue ext_dmz_mail bandwidth 50% priority 3
    queue dmz_main bandwidth 25Mb cbq(default borrow red) queue { dmz_main_hi, \
         dmz_main_lo }
         queue dmz_main_hi priority 7 bandwidth 20%
         queue dmz_main_lo priority 0 bandwidth 80%
    queue dmz_web bandwidth 25Mb cbq(borrow red)
    queue dmz_udp bandwidth 20Mb cbq(borrow red)
    queue dmz_mail bandwidth 20Mb cbq(borrow red)