由 小毅 在 04-09-2004 19:10 发表:
RH AS 3 IPTABLES扩展功能的增加模块
小弟最近搞学校的网关.在应用IPTABLES需要到其中的扩展功能.这些功能需要下载内核补丁.重新编译才能应用..
为了大家方便.我把三个常用功能编译成模块.放上来供大家使用:这三个模块名:TTL connlimit time.
具体说明如下:
> quote:
>
> * * *
>
> TTL:可以改变ping返回的TTL值
>
>
>
> Author: Harald Welte
1<laforge@gnumonks.org>
2>
3> Status: Stable, needs new checksum handling
4>
5>
6>
7>
8>
9> This adds an iptables TTL manipulation target, which enables the user
10>
11> to set the TTL value of an IP packet or to increment / decrement it
12>
13> by a given value.
14>
15>
16>
17> Examples:
18>
19>
20>
21> iptables -t mangle -A OUTPUT -o eth0 -j TTL --ttl-set 128
22>
23>
24>
25>
26>
27> connlimit:限制同一IP的并发线程数.
28>
29> Author: Gerd Knorr <kraxel@bytesex.org>
30>
31> Status: ItWorksForMe[tm]
32>
33>
34>
35>
36>
37> This adds an iptables match which allows you to restrict the
38>
39> number of parallel TCP connections to a server per client IP address
40>
41> (or address block).
42>
43>
44>
45> Examples:
46>
47>
48>
49> # allow 2 telnet connections per client host
50>
51> iptables -p tcp --syn --dport 23 -m connlimit --connlimit-above 2 -j REJECT
52>
53>
54>
55> # you can also match the other way around:
56>
57> iptables -p tcp --syn --dport 23 -m connlimit ! --connlimit-above 2 -j ACCEPT
58>
59>
60>
61> # limit the nr of parallel http requests to 16 per class C sized
62>
63> # network (24 bit netmask)
64>
65> iptables -p tcp --syn --dport 80 -m connlimit --connlimit-above 16 \
66>
67> \--connlimit-mask 24 -j REJECT
68>
69>
70>
71>
72>
73> time:时间定时功能
74>
75>
76>
77> Author: Fabrice MARIE <fabrice@netfilter.org>
78>
79> Status: It Works For Me.
80>
81>
82>
83> This option adds CONFIG_IP_NF_MATCH_TIME, which supplies a time match module.
84>
85> This match allows you to filter based on the packet arrival time
86>
87> (arrival time at the machine which the netfilter is running on) or
88>
89> departure time (for locally generated packets).
90>
91>
92>
93> Supported options are:
94>
95> \--timestart HH:MM
96>
97> The starting point of the time match frame.
98>
99>
100>
101> \--timestop HH:MM
102>
103> The stopping point of the time match frame
104>
105>
106>
107> \--days Tue,Mon...
108>
109> Days of the week to match separated by a coma, no space
110>
111> (one of Sun,Mon,Tue,Wed,Thu,Fri,Sat)
112>
113>
114>
115> Example:
116>
117> -A INPUT -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri
118>
119> will match packets that have an arrival timestamp in the range 8:00->18:00 from Monday
120>
121> to Friday.
122>
123>
124>
125> -A OUTPUT -m time --timestart 8:00 --timestop 18:00 --Days Mon
126>
127> will match the packets (locally generated) that have a departure timestamp
128>
129> in the range 8:00->18:00 on Monday only.
130>
131> * * *
132
133
134
135
136
137
138
139下面的附件是针对iptables1.2.9的模块文件....
140
141rh as 3自带的是1.2.8版本.你需要升级iptables1.2.9或者重新编译1.2.8版本.加入time和connlimit的lib库才能用..
142
143
144
145
146
147下载解压后运行modadd就可以了...
148
149
150
151
152* * *
153
154
155_由 小毅 在 04-09-2004 19:13 发表:_
156
157
158
159****
160
161
162
163
164
165下面的附件是针对iptables1.2.8版本的模块文件!!
166
167
168
169只有TTL 和 iplimit模块...iplimit的功能和用法与connlimit是一样的.只是iptables1.2.8的lib库只有libiplimit.so,没有connlimit 和time的lib库....
170
171
172
173
174
175下载解压后运行modadd即可
176
177
178
179
180* * *
181
182
183_由 小毅 在 04-09-2004 19:32 发表:_
184
185
186
187**还有一个支持netmeeting语音的模块h323-conntrack-nat**
188
189
190
191
192
193介绍:
194
195
196
197
198
199> quote:
200>
201> * * *
202>
203>
204>
205> h323-conntrack-nat:支持netmeeting语音的模块
206>
207> Author: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu>
208>
209> Status: Alpha
210>
211>
212>
213>
214>
215>
216>
217> This adds CONFIG_IP_NF_H323: H.323/netmeeting support module for netfilter
218>
219> connection tracking and NAT. H.323 uses/relies on the following data streams:
220>
221>
222>
223> Port Description
224>
225> 389 Internet Locator Server (TCP)
226>
227> 522 User Location Server (TCP)
228>
229> 1503 T.120 Protocol (TCP)
230>
231> 1720 H.323 (H.225 call setup, TCP)
232>
233> 1731 Audio call control (TCP)
234>
235> Dynamic H.245 call control (TCP)
236>
237> Dynamic RTCP/RTP streaming (UDP)
238>
239>
240>
241> The H.323 conntrack/NAT modules support the connection tracking/NATing of
242>
243> the data streams requested on the dynamic ports. The helpers use the
244>
245> search/rep</kadlec@blackhole.kfki.hu></fabrice@netfilter.org></kraxel@bytesex.org></laforge@gnumonks.org>