CIDR 是 Internet 上一种新的定址方式,可以比旧有 Class A, B, C 的定址方式更有效地分 配 IP 位址。
CIDR 区块前置字(prefix) # 相对应的 Class C # 位址数 /27 1/8th of a Class C 32 hosts /26 1/4th of a Class C 64 hosts /25 1/2 of a Class C 128 hosts /24 1 Class C 256 hosts /23 2 Class C 512 hosts /22 4 Class C 1,024 hosts /21 8 Class C 2,048 hosts /20 16 Class C 4,096 hosts /19 32 Class C 8,192 hosts /18 64 Class C 16,384 hosts /17 128 Class C 32,768 hosts /16 256 Class C 65,536 hosts (= 1 Class /15 512 Class C 131,072 hosts /14 1,024 Class C 262,144 hosts /13 2,048 Class C 524,288 hosts
欲获得更多关於 CIDR 的技术资料,请至 ,然後 输入你有兴趣的 RFC 号码:
RFC 1517: Applicability Statement for the Implementation of CIDR RFC 1518: An Architecture for IP Address Allocation with CIDR RFC 1519: CIDR: An Address Assignment and Aggregation Strategy RFC 1520: Exchanging Routing Information Across Provider Boundaries in the CIDR Environment
Lee wrote.. Initializing rule chains... log_database: Database type is mysql log_database: Database name is snort log_database: Host set to localhost log_database: User set to root Problem obtaining SENSOR ID (sid) from mysql-snort-event
--faq-- --snort-- --faq-- --snort-- --faq-- --snort-- --faq-- 问:为什麽 snort 报告 "Packet loss statistics are unavailable under Linux"(封包流失统计在 linux 中不能使用) 的讯息?
答:Linux IP 层并不提供封包流失的状态统计。可能在 Linux 2.4 会有,但现在没有。可以改用 BSD 系统,这项功能运作地很好。
#!/bin/sh # # Logfile roation script for snort writen by jameso@elwood.net. # # This script is pretty basic. We start out by setting some vars. # Its job is tho rotate the days logfiles, e-mail you with what # it logged, keep one weeks worth of uncompressed logs, and also # keep compressed tgz files of all the logs. It is made to be run # at midnight everynight. This script expects you to have a base # dir that you keep all of your logs, rule sets etc in. You can # see what sub dirs it expects from looking at the var settings # below. # # Things to note in this script is that we run this script at 12 # every night, so we want to set the dirdate var the day the script # runs minus a day so we label the files with the correct day. We # Then create a dir for the days logs, move the log files into # todays dir. As soon as that is done restart snort so we don't miss # anything. Then delete any logs that are uncompressed and over a # week old. Then compress out todays logs and archive them away, and # end up by mailling out the logs to you. #
# Define where you have the base of your snort install
snortbase=/usr/snort
# Define other vars # logdir - Where the logs are kept # oldlogs - Where you want the archived .tgz logs kept # weeklogs - This is where you want to keep a weeks worth of log files uncompressed # dirdate - Todays Date in Month - Day - Year format # olddirdate - Todays date in the same format as dirdate, minus a week
# When I first wrote this script, I only ran it on BSD systems. That was a # mistake, as BSD systems have a date command that apperently lets you walk the # date back pretty easily. Well, some systems don't have this feature, so I had # to change the way that dates are done in here. I left in the old way, because # it is cleaner, and I added in a new way that should be portable. If anyone # has any problems, just let me know and I will try to fix it. # # You have to change the system var to either bsd or other. Set it to bsd if # your system supports the "-v" flag. If you are not sure, set it to other.
dirdate=$month-$yesterday-$year olddirdate=$month-$eightday-$year fi
# Create the Dir for todays logs.
if [ ! -d $weeklogs/$dirdate ] then mkdir $weeklogs/$dirdate fi
# Move the log files into todays log dir. This is done with # a for loop right now, because I am afriad that if alot is # logged there may be to many items to move with a "mv *" # type command. There may a better way to do this, but I don't # know it yet.
for logitem in `ls $logdir` ; do mv $logdir/$logitem $weeklogs/$dirdate done
# Kill and restart snort now that the log files are moved.
# Delete any uncompressed log files that over a week old.
if [ -d $weeklogs/$olddirdate ] then rm -r $weeklogs/$olddirdate fi
# Compress and save the log files to save for as long as you want. # This is done in a sub-shell because we change dirs, and I don't want # to do that within the shell that the script runs in.
(cd $weeklogs; tar zcvf $oldlogs/$dirdate.tgz $dirdate /dev/null 2&1)
# Mail out the log files for today.
cat $weeklogs/$dirdate/snort.alert | mail -s "Snort logs" you@domain.com cat $weeklogs/$dirdate/snort_portscan.log | mail -s "Snort portscan logs" you@domain.com