diff options
| author | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:00:14 +0900 |
|---|---|---|
| committer | beatrice <beatrice@dangofactory.net> | 2026-11-22 20:00:14 +0900 |
| commit | 8f68d02045982da8f00a559835b500caf3a1967d (patch) | |
| tree | c8d0e92969b92e1b6559a0e032b6aa710a8ae2d9 /contrib/ipchains/ipchainacc.rules | |
| parent | bb5ff95073e5001be7dbf58ffce80d7926deff0b (diff) | |
| download | mrtg-master.tar.gz mrtg-master.zip | |
Diffstat (limited to 'contrib/ipchains/ipchainacc.rules')
| -rwxr-xr-x | contrib/ipchains/ipchainacc.rules | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/contrib/ipchains/ipchainacc.rules b/contrib/ipchains/ipchainacc.rules new file mode 100755 index 0000000..3be5f63 --- /dev/null +++ b/contrib/ipchains/ipchainacc.rules @@ -0,0 +1,36 @@ +#!/bin/bash + +#--- sample ipchains rules for accounting + +# Flush the rules in case they exist already +/sbin/ipchains -F acctin +/sbin/ipchains -F acctout + +# add the new rule chains +/sbin/ipchains -N acctin +/sbin/ipchains -N acctout + +# add empty rules to the new chains just for accounting +/sbin/ipchains -A acctin +/sbin/ipchains -A acctout + +# insert rules into the input and output streams. +# Packets will first pass through these rules before +# returning to the other rules in the chains +# You might not want this if you are trying to +# completely ignore certain hosts. +/sbin/ipchains -I input -j acctin +/sbin/ipchains -I output -j acctout + +# if you wanted to narrow the accouting to a single IP +# you could do these lines instead of the above 2 (not tested) +# (assuming your IP address was 192.168.1.1) +#/sbin/ipchains -I input -d 192.168.1.1 -j acctin +#/sbin/ipchains -I output -s 192.168.1.1 -j acctout + +# By changing the rules, you can make it filter only exactly +# what you want as long as it jumps to acctin, or acctout. +# Be careful not to double count packets though. + +#----------- end --------------- + |
