/share/examples/pf/queue2

https://bitbucket.org/freebsd/freebsd-head/ · #! · 29 lines · 25 code · 4 blank · 0 comment · 0 complexity · a4091fddcd32eba72a9ed0be9573d102 MD5 · raw file

  1. # $FreeBSD$
  2. # $OpenBSD: queue2,v 1.4 2006/10/07 04:48:01 mcbride Exp $
  3. # advanced queue example.
  4. # give interactive ssh traffic priority over ssh bulk transfers (scp, sftp)
  5. ext_if="dc0"
  6. developerhosts="192.168.2.0/24"
  7. employeehosts="192.168.0.0/23"
  8. altq on $ext_if cbq bandwidth 5Mb queue { std, http, mail, ssh }
  9. queue std bandwidth 10% cbq(default)
  10. queue http bandwidth 60% priority 2 cbq(borrow red) { employees, developers }
  11. queue developers bandwidth 75% cbq(borrow)
  12. queue employees bandwidth 15%
  13. queue mail bandwidth 10% priority 0 cbq(borrow ecn)
  14. queue ssh bandwidth 20% cbq(borrow) { ssh_interactive, ssh_bulk }
  15. queue ssh_interactive bandwidth 25% priority 7
  16. queue ssh_bulk bandwidth 75% priority 0
  17. block return out on $ext_if inet all queue std
  18. pass out on $ext_if inet proto tcp from $developerhosts to any port 80 \
  19. queue developers
  20. pass out on $ext_if inet proto tcp from $employeehosts to any port 80 \
  21. queue employees
  22. pass out on $ext_if inet proto tcp from any to any port 22 \
  23. queue(ssh_bulk, ssh_interactive)
  24. pass out on $ext_if inet proto tcp from any to any port 25 \
  25. queue mail