* vladimir m. bondarev wrote on Fri, Nov 24, 2000 at 19:41 +0300:
SD> ACC_RANGE="192.168.9:9-11 192.168.11:1-254 192.168.12:1-254"
the only thing i don't understand, how to set this range? what 192.168.9:9-11 mean? (sorry my stupid question.
This is the value for the variable ACC_RANGE. The code snippets that followed in the original mail are extracted from the firewall (bash-) script I use here. The function call looked just: account_ranges $ACC_RANGE; Haveing a variable here is neccesary in my script, since it parses an own configfile to get the options (I don't like sourceing since it may have side effects and so on). This variable is parsed in the following way be the code I posted: A incomplete class-C looking string describing a network except its last octet, i.e. for 192.168.9.x it's 192.168.9. This is followed by a colon and a range of IP addresses (the last octet). If you use 192.168.9:9-11 it stays for 192.168.9.9, 192.168.9.10 and 192.168.9.11. The class C network can be written as 192.168.9:1-254 (all IPs except .0== network and .255 == Broadcast). In constrast to the notation 192.168.9.0/24 or 192.168.9.0/255.255.255.0 the traffic for each IP address is meant, not the whole network. The code snippet generates 254 firewall accounting rules for an entry like 192.168.9:1-254. The other script that can be found under the postet URL is able to handle this. It evalutes the output from ipchains (or ipfwadm) and keeps the sums in a logfile /var/log/accountings. It generates nice output and is able to calculate estimated costs at a "per 1 GB traffic" base. Hope I were understandable this time. Have a nice weekend, list. oki, Steffen -- Dieses Schreiben wurde maschinell erstellt, es trägt daher weder Unterschrift noch Siegel.