小弟最近搞学校的网关.在应用IPTABLES需要到其中的扩展功能.这些功能需要下载内核补丁.重新编译才能应用..
为了大家方便.我把三个常用功能编译成模块.放上来供大家使用:这三个模块名:TTL connlimit time.
具体说明如下:
TTL:可以改变ping返回的TTL值
Author: Harald Welte <laforge@gnumonks.org>
Status: Stable, needs new checksum handling
This adds an iptables TTL manipulation target, which enables the user
to set the TTL value of an IP packet or to increment / decrement it
by a given value.
Examples:
iptables -t mangle -A OUTPUT -o eth0 -j TTL --ttl-set 128
connlimit:限制同一IP的并发线程数.
Author: Gerd Knorr <kraxel@bytesex.org>
Status: ItWorksForMe[tm]
This adds an iptables match which allows you to restrict the
number of parallel TCP connections to a server per client IP address
(or address block).
Examples:
# allow 2 telnet connections per client host
iptables -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j REJECT
# you can also match the other way around:
iptables -p tcp --syn --dport 23 -m connlimit ! --connlimit-above 2 -j ACCEPT
# limit the nr of parallel http requests to 16 per class C sized
# network (24 bit netmask)
iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 16 \
--connlimit-mask 24 -j REJECT
time:时间定时功能
Author: Fabrice MARIE <fabrice@netfilter.org>
Status: It Works For Me.
This option adds CONFIG_IP_NF_MATCH_TIME, which supplies a time match module.
This match allows you to filter based on the packet arrival time
(arrival time at the machine which the netfilter is running on) or
departure time (for locally generated packets).
Supported options are:
--timestart HH:MM
The starting point of the time match frame.
--timestop HH:MM
The stopping point of the time match frame
--days Tue,Mon...
Days of the week to match separated by a coma, no space
(one of Sun,Mon,Tue,Wed,Thu,Fri,Sat)
Example:
-A INPUT -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri
will match packets that have an arrival timestamp in the range 8:00->18:00 from Monday
to Friday.
-A OUTPUT -m time --timestart 8:00 --timestop 18:00 --Days Mon
will match the packets (locally generated) that have a departure timestamp
in the range 8:00->18:00 on Monday only.
下面的附件是针对iptables1.2.9的模块文件....
rh as 3自带的是1.2.8版本.你需要升级iptables1.2.9或者重新编译1.2.8版本.加入time和connlimit的lib库才能用..
下载解压后运行modadd就可以了... |