counters.sample 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. # Scenario:
  2. # You're billed for traffic except internal networks
  3. # 192.168.0.0 mask 255.255.0.0 and 10.0.0.0 mask 255.0.0.0.
  4. # If you exceed 2Gb limit you will have very high penalty
  5. #
  6. # You want to have daily report about common amount of external traffic.
  7. # You also need to know amount of Web traffic for every user
  8. # You want to limit Web traffic to 100Mb/day to whole campus and
  9. # to 20MB/day to every user
  10. # see explanations in 3proxy.cfg.sample
  11. internal 192.168.1.1
  12. external 10.1.1.1
  13. nserver 10.1.2.1
  14. nserver 10.2.2.2
  15. nscache 65536
  16. dnspr
  17. # no logging will be used, only traffic reports
  18. # use d:\3proxy\3profy.3cf to store counters data
  19. # generate daily traffic reports in d:\3proxy\traf\
  20. counter "d:\3proxy\3profy.3cf" D "d:\3proxy\traf\traf"
  21. # define users
  22. users "user1:CL:password1" "user2:CL:password2" "user3:CL:password3"
  23. users "user4:CL:password4" "user5:CL:password5" "user6:CL:password6"
  24. # ...
  25. # do not count traffic for 192.168.0.0/16,10.0.0.0/8
  26. nocountin * * 192.168.0.0/16,10.0.0.0/8
  27. # Count external traffic summary for all clients with limit to 100MB/day
  28. countin "1/Test 1" D 100 *
  29. # Count external Web traffic summary for all clients to 1Gb/month
  30. countin "2/Test 2" M 1024 vlad,3APA3A,test 127.0.0.1 * 80,81,8080-8088
  31. # For every user count and limit daily Web traffic to 20 Mb
  32. # There is no way to configure it in a single line, we need a line
  33. # for every user we have
  34. countin "3/User 1" D 20 user1 * * 80,81,8080-8088
  35. countin "4/User 2" D 20 user2 * * 80,81,8080-8088
  36. # ...
  37. countin "202/User 200" D 20 user200 * * 80,81,8080-8088
  38. # enable proxy
  39. auth strong
  40. proxy
  41. # enable administration to user1 from localhost
  42. internal 127.0.0.1
  43. allow user1
  44. admin