This file is indexed.

/usr/share/doc/HOWTO/ja-html/IPCHAINS-HOWTO-7.html is in doc-linux-ja-html 2006.05.25-1.1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<HTML>
<HEAD>
 <META NAME="GENERATOR" CONTENT="LinuxDoc-Tools 0.9.21">
 <TITLE>Linux IPCHAINS-HOWTO: $B<BMQE*$JNc(B</TITLE>
 <LINK HREF="IPCHAINS-HOWTO-8.html" REL=next>
 <LINK HREF="IPCHAINS-HOWTO-6.html" REL=previous>
 <LINK HREF="IPCHAINS-HOWTO.html#toc7" REL=contents>
</HEAD>
<BODY>
<A HREF="IPCHAINS-HOWTO-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="IPCHAINS-HOWTO-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="IPCHAINS-HOWTO.html#toc7">$BL\<!$X(B</A>
<HR>
<H2><A NAME="s7">7.</A> <A HREF="IPCHAINS-HOWTO.html#toc7">$B<BMQE*$JNc(B</A></H2>

<P>$B$3$NHONc$O!"(B1999 $BG/$N(B 3 $B7n$K3+:E$5$l$?(B LinuxWorld $B$G(B Michael Neuling 
$B$H;d$,H/I=$7$?%A%e!<%H%j%"%k$+$i0zMQ$7$^$7$?!#$3$l$O!"M?$($i$l$?Ld(B
$BBj$r2r7h$9$k$?$a$NM#0l$NJ}K!$G$O$J$$$G$9$,!"B?J,:G$bC1=c$J$b$N$G$9!#(B
$B$3$NHONc$rM-1W$J$b$N$@$H;W$C$FD:$1$l$P9,$$$G$9!#(B</P>



<H2><A NAME="ss7.1">7.1</A> <A HREF="IPCHAINS-HOWTO.html#toc7.1">$B9=@.(B</A>
</H2>

<P>
<UL>
<LI>$B%^%9%+%l!<%I$5$l$?FbIt%M%C%H%o!<%/(B($BMM!9$J(B OS $B$,B8:_$7$F$$$^$9(B)
$B$,B8:_$7!"(B&quot;GOOD&quot; $B$H8F$S$^$9!#(B</LI>
<LI>$BJ,N%$5$l$?%M%C%H%o!<%/>e$K8x3+%5!<%P$,B8:_$7$F$$$^$9(B($BHsIpAu2=(B
$BCOBS(B &quot;Demilitarized Zone&quot; $B$H$$$&$3$H$G(B &quot;DMZ&quot; $B$H8F$S$^$9(B)$B!#(B</LI>
<LI>$B%$%s%?!<%M%C%H$X(B PPP $B@\B3$7$F$$$^$9(B( &quot;BAD&quot; $B$H8F$S$^$9(B)$B!#(B</LI>
</UL>
</P>


<P>
<BLOCKQUOTE><CODE>
<PRE>
   $B30It%M%C%H%o!<%/(B (BAD)
           $B("(B
           $B("(B
       ppp0$B("(B
   $B(#(!(!(!(!(!(!(!($(B
   $B("(B192.84.219.1  $B("(B             $B%5!<%P%M%C%H%o!<%/(B (DMZ)
   $B("(B              $B("(Beth0
   $B("(B              $B("(!(!(!(!(!(!(!(((!(!(!(!(!(!(((!(!(!(!(!(!(((!(B
   $B("(B              $B("(B192.84.219.250$B("(B            $B("(B            $B("(B
   $B("(B              $B("(B              $B("(B            $B("(B            $B("(B 
   $B("(B192.168.1.250 $B("(B              $B("(B            $B("(B            $B("(B   
   $B(&(!(!(!(!(!(!(!(%(B          $B(#(!(!(!($(B    $B(#(!(!(!($(B    $B(#(!(!(!($(B   
           $B("(B eth1             $B("(B SMTP $B("(B    $B("(B DNS  $B("(B    $B("(B WWW  $B("(B
           $B("(B                  $B(&(!(!(!(%(B    $B(&(!(!(!(%(B    $B(&(!(!(!(%(B
           $B("(B              192.84.219.128  192.84.219.129  192.84.218.130
           $B("(B
   $BFbIt%M%C%H%o!<%/(B (GOOD)
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H2><A NAME="ss7.2">7.2</A> <A HREF="IPCHAINS-HOWTO.html#toc7.2">$BL\E*(B</A>
</H2>



<P>$B%Q%1%C%H%U%#%k%?!<%^%7%s(B: </P>

<P>
<DL>
<DT><B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B PING $B$,2DG=(B</B><DD><P>$B%^%7%s$,%@%&%s$7$F$$$k$+$I$&$+$rCN$k$N$KBgJQLr$KN)$A$^$9!#(B</P>


<DT><B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B TRACEROUTE $B$,2DG=(B</B><DD><P>$B$3$l$b$^$?!"860xJ,@O$KLr$KN)$A$^$9!#(B</P>


<DT><B>DNS $B$X$N%"%/%;%9$,2DG=(B</B><DD><P>ping $B$H(B DNS $B$r$h$j;H$$$d$9$/$9$k$?$a$G$9!#(B</P>
</DL>
</P>


<P>DMZ $BFb(B: </P>


<P>$B%a!<%k%5!<%P(B
<UL>
<LI> $B30It%M%C%H%o!<%/$X$N(B SMTP $B$,2DG=(B</LI>
<LI> $BFbIt$H30It%M%C%H%o!<%/$+$i$N(B SMTP $B$N%"%/%;%W%H(B($B<u$1F~$l(B)$B$,2DG=(B</LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i$N(B POP-3 $B$N%"%/%;%W%H$,2DG=(B</LI>
</UL>
</P>


<P>$B%M!<%`%5!<%P(B
<UL>
<LI> $B30It%M%C%H%o!<%/$X$N(B DNS $B$NMW5a$,2DG=(B</LI>
<LI> $BFbIt$H30It%M%C%H%o!<%/!"%Q%1%C%H%U%#%k%?!<%^%7%s$+$i$N(B DNS $B$N(B
$B%"%/%;%W%H$,2DG=(B</LI>
</UL>
</P>


<P>$B%&%'%V%5!<%P(B
<UL>
<LI> $BFbIt$H30It%M%C%H%o!<%/$+$i$N(B HTTP $B$N%"%/%;%W%H$,2DG=(B</LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i$N(B Rsync $B$K$h$k%"%/%;%9$,2DG=(B</LI>
</UL>
 </P>


<P> $BFbIt%M%C%H%o!<%/(B: </P>

<P>
<DL>
<DT><B>$B30It%M%C%H%o!<%/$X$N(B WWW, ftp ,traceroute, ssh $B$r5v2D$9$k(B</B><DD><P>$B$3$l$i$O!"5v2D$NBP>]$H$7$F$O$+$J$jI8=`E*$J$3$H$G$9!#FbIt%M%C(B
$B%H%o!<%/>e$N%^%7%s$KBP$7$F$[$\A4$F$r5v2D$9$k$3$H$+$i;O$a$^$9(B
$B$,!"$3$3$G$O@)8B$r$+$1$F$$$^$9!#(B</P>


<DT><B>$B%a!<%k%5!<%P$X$N(B SMTP $B$r5v2D$9$k(B </B><DD><P>$BEvA3!"%a!<%k$O30It$XAw?.$G$-$k$h$&$K$7$?$$$G$9!#(B</P>


<DT><B> $B%a!<%k%5!<%P$X$N(B POP-3 $B$r5v2D$9$k(B </B><DD><P>$B%a!<%k$rFI$`J}K!$G$9!#(B</P>


<DT><B> $B%M!<%`%5!<%P$X$N(B DNS $B$r5v2D$9$k(B </B><DD><P>WWW $B$H(B ftp, traceroute, ssh $B$rMxMQ$9$k:]$K!"30It%M!<%`$N8!:w(B
$B$r$9$k$N$KI,MW$G$9!#(B</P>


<DT><B> $B%&%'%V%5!<%P$X$N(B rsync $B$r5v2D$9$k(B </B><DD><P>$B30It8~$1%&%'%V%5!<%P$HFbIt%&%'%V%5!<%P$rF14|$5$;$kJ}K!$G$9!#(B</P>

<DT><B> $B%&%'%V%5!<%P$X$N(B WWW $B$r5v2D$9$k(B </B><DD><P>$BEvA3!"30It8~$1%&%'%V%5!<%P$X@\B3$G$-$k$Y$-$G$9!#(B</P>


<DT><B> $B%Q%1%C%H%U%#%k%?!<%^%7%s$X$N(B ping $B$r5v2D$9$k(B </B><DD><P>$B$3$l$O!"0lHLE*$K9-$/MFG'$5$l$F$$$k$3$H$G$9!#$D$^$j%U%!%$%"(B
$B%&%)!<%k%^%7%s$,%@%&%s$7$F$$$k$+$I$&$+$r!"3NG'$G$-$k$h$&$K(B
$B$9$k$?$a$G$9(B($B$=$l$G30It%5%$%H$,2u$l$F$$$?>l9g$O!"HsFq$5$l$^(B
$B$;$s$N$G(B)$B!#(B</P>
</DL>
</P>


<H2><A NAME="ss7.3">7.3</A> <A HREF="IPCHAINS-HOWTO.html#toc7.3">$B%Q%1%C%H%U%#%k%?%j%s%0$r9T$&A0$K(B</A>
</H2>

<P>
<UL>
<LI> IP $B56AuJ]8n(B (Anti-spoofing)
<P>$B$$$+$J$kHsBP>N$N%k!<%F%#%s%0$b;}$C$F$$$J$$$N$G!"A4$F$N%$%s%?!<(B
$B%U%'!<%9$KBP$7$F(B IP $B56AuJ]8n$rC1$K%*%s$G$-$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
# for f in /proc/sys/net/ipv4/conf/*/rp_filter; do echo 1 > $f; done
#
</PRE>
</CODE></BLOCKQUOTE>
</P>


</LI>
<LI> $B%U%#%k%?%j%s%0$N%k!<%k$H$7$FA4$F$r5qH]$K$9$k(B
<P>$B:#$^$GDL$j%m!<%+%k$N%k!<%W%P%C%/%H%i%U%#%C%/$O5v2D$7$^$9$,!"$=$l0J30(B
$B$NA4$F$r5qH]$7$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
# ipchains -A input -i ! lo -j DENY
# ipchains -A output -i ! lo -j DENY
# ipchains -A forward -j DENY
#
</PRE>
</CODE></BLOCKQUOTE>
</P>


</LI>
<LI> $B%$%s%?!<%U%'!<%9$N%;%C%H%"%C%W(B
<P>$B%$%s%?!<%U%'!<%9$N%;%C%H%"%C%W$O!"BgDq%V!<%H;~$N%9%/%j%W%H(B
$B$G<B9T$5$l$^$9!#%U%#%k%?%j%s%0$N%k!<%k$,E,MQ$5$l$kA0$K%Q%1%C%H(B
$B$,O3$l$@$9$3$H$rKI$00Y$K!"%$%s%?!<%U%'!<%9$,@_Dj$5$l$kA0$K>e5-(B
$B$N%9%F%C%W$,<B9T$5$l$F$$$k$3$H$r3NG'$7$F2<$5$$!#(B</P>


</LI>
<LI> $B%W%m%H%3%kJL$K%^%9%+%l!<%I%b%8%e!<%k$rAH$_9~$`(B
<P>FTP $B$rMxMQ$9$k:]$K$O!"%^%9%+%l!<%I%b%8%e!<%k$rAH$_9~$`I,MW$,$"(B
$B$j$^$9!#$=$&$9$k$3$H$G!"FbIt%M%C%H%o!<%/$+$i$N%"%/%F%#%V$H%Q%C(B
$B%7%V(B FTP $B$,(B `$B$A$c$s$HF0:n$7$^$9(B'$B!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
# insmod ip_masq_ftp
#
</PRE>
</CODE></BLOCKQUOTE>
</P>
</LI>
</UL>
</P>


<H2><A NAME="ss7.4">7.4</A> <A HREF="IPCHAINS-HOWTO.html#toc7.4">$B%Q%1%C%H$rDL2a$5$;$k$?$a$N%Q%1%C%H%U%#%k%?%j%s%0(B</A>
</H2>

<P>$B%^%9%+%l!<%I$r;HMQ$7$F!"(Bforward $B%A%'%$%s$G%U%#%k%?!<$r$+$1$k$3$H$O(B
$B:GNI$NJ}K!$G$9!#(B</P>
<P>forward $B%A%'%$%s$r%=!<%9!?$"$F@h(B $B%$%s%?!<%U%'!<%9$K9g$o$;$FMM!9$J%f(B
$B!<%6Dj5A%A%'%$%s$KJ,3d$7$F2<$5$$!#$D$^$j!"LdBj$r<h07$$$d$9$$C10L(B
$B$KJ,2r$9$k$N$G$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -N good-dmz
ipchains -N bad-dmz
ipchains -N good-bad
ipchains -N dmz-good
ipchains -N dmz-bad
ipchains -N bad-good
</PRE>
</CODE></BLOCKQUOTE>
</P>

<P>ICMP $B$NI8=`%(%i!<$r%"%/%;%W%H$9$k$3$H$O!"6&DL$NFbMF$G$9!#$7$?$,$C$F!"(B
$B$=$N$?$a$N%A%'%$%s$r:n$j$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -N icmp-acc
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H3>forward $B%A%'%$%s$+$i%8%c%s%W$5$;$k(B</H3>

<P>$B;DG0$J$3$H$K!"(B(forward $B%A%'%$%s$G$O(B)$B=PNO%$%s%?!<%U%'!<%9$7$+J,$+$j(B
$B$^$;$s!#$7$?$,$C$F!"%Q%1%C%H$,$I$N%$%s%?!<%U%'!<%9$+$iF~$C$F$/$k$+(B
$B$r8+H4$/$?$a$K!"%=!<%9%"%I%l%9$r;HMQ$7$^$9(B($B56AuJ]8n$,%"%I%l%9$N$J(B
$B$j$9$^$7$rKI$$$G$$$k$N$GBg>fIW$G$9(B)$B!#(B</P>


<P>$B$3$l$i$N$$$:$l$K$b%^%C%A$7$J$$%Q%1%C%H(B($BL@$i$+$K!"$=$N$h$&$J$3$H$O5/(B
$B$3$i$J$$$O$:$G$9$,(B)$B$OA4$F%m%0$r<h$k$3$H$KCm0U$7$F2<$5$$!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -A forward -s 192.168.1.0/24 -i eth0 -j good-dmz
ipchains -A forward -s 192.168.1.0/24 -i ppp0 -j good-bad
ipchains -A forward -s 192.84.219.0/24 -i ppp0 -j dmz-bad
ipchains -A forward -s 192.84.219.0/24 -i eth1 -j dmz-good
ipchains -A forward -i eth0 -j bad-dmz
ipchains -A forward -i eth1 -j bad-good
ipchains -A forward -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H3>icmp-acc $B%A%'%$%s$rDj5A$9$k(B</H3>

<P>$B%Q%1%C%H$,(B($B0J2<$N(B)$B%(%i!<(B ICMP $B$N$$$:$l$+$J$i%"%/%;%W%H$5$l$^$9!#(B
$B$5$b$J$1$l$P!"%^%C%A$7$J$+$C$?%Q%1%C%H$KBP$9$k@)8f$O(B icmp-acc $B%A%'%$%s(B
$B$+$iH4$1$F!"8F=P$785$N%A%'%$%s$KLa$5$l$k$3$H$K$J$j$^$9!#(B</P>
<P>
<BLOCKQUOTE><CODE>
<PRE>
ipchains -A icmp-acc -p icmp --icmp-type destination-unreachable -j ACCEPT
ipchains -A icmp-acc -p icmp --icmp-type source-quench -j ACCEPT
ipchains -A icmp-acc -p icmp --icmp-type time-exceeded -j ACCEPT
ipchains -A icmp-acc -p icmp --icmp-type parameter-problem -j ACCEPT
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H3>GOOD ($BFbIt%M%C%H%o!<%/(B) $B$+$i(B DMZ ($B%5!<%P%M%C%H%o!<%/(B)</H3>

<P>$BFbIt%M%C%H%o!<%/$KBP$9$k@)8B(B : 
<UL>
<LI> $B30It%M%C%H%o!<%/$X$N(B WWW, ftp, traceroute, ssh $B$r5v2D$9$k(B</LI>
<LI> <B>$B%a!<%k%5!<%P$X$N(B SMTP $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%a!<%k%5!<%P$X$N(B POP-3 $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%M!<%`%5!<%P$X$N(B DNS $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%&%'%V%5!<%P$X$N(B rsync $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%&%'%V%5!<%P$X$N(B WWW $B$r5v2D$9$k(B</B></LI>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s$X$N(B ping $B$r5v2D$9$k(B</LI>
</UL>
</P>

<P>$BFbIt%M%C%H%o!<%/$+$i(B DMZ $B$N:]$K%^%9%+%l!<%I$O$G$-$^$9$,!"$3$3$G$O9T(B
$B$$$^$;$s!#FbIt%M%C%H%o!<%/>e$N$I$N%^%7%s$b0-0U$N$"$k$3$H$r$7$J$$$O(B
$B$:$J$N$G!"5qH]$5$l$kA4$F$N%Q%1%C%H$N%m%0$r<h$j$^$9!#(B</P>


<P>Debian $B$N8E$$%P!<%8%g%s$G$O!"(B/etc/services $B>e$N(B `pop3' $B$r(B`pop-3' $B$H(B
$B8F$V$N$GCm0U$7$F2<$5$$!#$3$N$3$H$O(B RFC1700 $B$H0lCW$7$F$$$^$;$s!#(B
<BLOCKQUOTE><CODE>
<PRE>
   
ipchains -A good-dmz -p tcp -d 192.84.219.128 smtp -j ACCEPT
ipchains -A good-dmz -p tcp -d 192.84.219.128 pop3 -j ACCEPT
ipchains -A good-dmz -p udp -d 192.84.219.129 domain -j ACCEPT
ipchains -A good-dmz -p tcp -d 192.84.219.129 domain -j ACCEPT
ipchains -A good-dmz -p tcp -d 192.84.218.130 www -j ACCEPT
ipchains -A good-dmz -p tcp -d 192.84.218.130 rsync -j ACCEPT
ipchains -A good-dmz -p icmp -j icmp-acc
ipchains -A good-dmz -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</P>


<H3>BAD ($B30It%M%C%H%o!<%/(B)$B$+$i(B DMZ ($B%5!<%P%M%C%H%o!<%/(B)</H3>

<P>
<UL>
<LI> DMZ $B$KBP$9$k@)8B(B: 
<UL>
<LI> $B%a!<%k%5!<%P(B
<UL>
<LI> <B>$B30It%M%C%H%o!<%/$X$N(B SMTP $B$,2DG=(B</B></LI>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/$+$i$N(B SMTP $B$N%"%/%;%W%H$,2DG=(B</B></LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i$N(B POP-3 $B$N%"%/%;%W%H$,2DG=(B</LI>
</UL>
</LI>
<LI> $B%M!<%`%5!<%P(B
<UL>
<LI> <B>$B30It%M%C%H%o!<%/$X$N(B DNS $B$NMW5a$,2DG=(B</B></LI>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/(B</B>$B!"%Q%1%C%H%U%#%k%?!<%^%7%s(B<B>$B$+$i(B
$B$N(B DNS $B$N%"%/%;%W%H$,2DG=(B</B></LI>
</UL>
</LI>
<LI> $B%&%'%V%5!<%P(B
<UL>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/$+$i$N(B HTTP $B$N%"%/%;%W%H$,2DG=(B</B></LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i$N(B Rsync $B$N%"%/%;%W%H$,2DG=(B</LI>
</UL>
</LI>
</UL>
</LI>
<LI> $B30It%M%C%H%o!<%/$+$i(B DMZ $B$X5v2D$9$k$3$H(B
<UL>
<LI> $B?/329T0Y$K$D$$$F$O!"%m%0$O$H$i$:$=$N$^$^$K$9$k(B</LI>
</UL>

<BLOCKQUOTE><CODE>
<PRE>
ipchains -A bad-dmz -p tcp -d 192.84.219.128 smtp -j ACCEPT
ipchains -A bad-dmz -p udp -d 192.84.219.129 domain -j ACCEPT
ipchains -A bad-dmz -p tcp -d 192.84.219.129 domain -j ACCEPT
ipchains -A bad-dmz -p tcp -d 192.84.218.130 www -j ACCEPT
ipchains -A bad-dmz -p icmp -j icmp-acc
ipchains -A bad-dmz -j DENY
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>GOOD ($BFbIt%M%C%H%o!<%/(B)$B$+$i(B BAD ($B30It%M%C%H%o!<%/(B) </H3>

<P>
<UL>
<LI> $BFbIt%M%C%H%o!<%/$KBP$9$k@)8B(B: 
<UL>
<LI> <B>$B30It%M%C%H%o!<%/$X$N(B WWW, ftp ,traceroute, ssh $B$r5v2D$9$k(B</B></LI>
<LI> $B%a!<%k%5!<%P$X$N(B SMTP $B$r5v2D$9$k(B</LI>
<LI> $B%a!<%k%5!<%P$X$N(B POP-3 $B$r5v2D$9$k(B</LI>
<LI> $B%M!<%`%5!<%P$X$N(B DNS $B$r5v2D$9$k(B</LI>
<LI> $B%&%'%V%5!<%P$X$N(B rsync $B$r5v2D$9$k(B</LI>
<LI> $B%&%'%V%5!<%P$X$N(B WWW $B$r5v2D$9$k(B</LI>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s$X$N(B ping $B$r5v2D$9$k(B</LI>
</UL>
</LI>
<LI> $B0lHL$K!"FbIt%M%C%H%o!<%/$+$i30It%M%C%H%o!<%/$KBP$7$F$O!"(B
$BA4$F$r5v2D$7!"$=$l$+$i@)8B$r2C$($^$9!#2f!9$O!"%U%!%7%9%H$J$N$G$9!#(B
<UL>
<LI> $B?/329T0Y$N%m%0$r<h$k(B</LI>
<LI> $B%Q%C%7%V(B FTP $B$O!"%^%9%+%l!<%I%b%8%e!<%k$G=hM}$9$k(B</LI>
<LI> UDP $B$N(B $B$"$F@h%]!<%H(B 33434 $B0J9_(B $B$O(B traceroute $B$G;HMQ$5$l$k(B</LI>
</UL>

<BLOCKQUOTE><CODE>
<PRE>
      
ipchains -A good-bad -p tcp --dport www -j MASQ
ipchains -A good-bad -p tcp --dport ssh -j MASQ
ipchains -A good-bad -p udp --dport 33434:33500 -j MASQ
ipchains -A good-bad -p tcp --dport ftp -j MASQ
ipchains -A good-bad -p icmp --icmp-type ping -j MASQ
ipchains -A good-bad -j REJECT -l
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>DMZ $B$+$i(B GOOD ($BFbIt%M%C%H%o!<%/(B) </H3>

<P>
<UL>
<LI> $BFbIt%M%C%H%o!<%/$KBP$9$k@)8B(B: 
<UL>
<LI> $B30It%M%C%H%o!<%/$X$N(B WWW, ftp ,traceroute, ssh $B$r5v2D$9$k(B</LI>
<LI> <B>$B%a!<%k%5!<%P$X$N(B SMTP $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%a!<%k%5!<%P$X$N(B POP-3 $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%M!<%`%5!<%P$X$N(B DNS $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%&%'%V%5!<%P$X$N(B rsync $B$r5v2D$9$k(B</B></LI>
<LI> <B>$B%&%'%V%5!<%P$X$N(B WWW $B$r5v2D$9$k(B</B></LI>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s$X$N(B ping $B$r5v2D$9$k(B</LI>
</UL>
</LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i(B DMZ $B$N:]$K%^%9%+%l!<%I$9$k>l9g!"C1$K$=$l0J(B
$B30$N%Q%1%C%H$r5qH]$7$F2<$5$$!#<B$N$H$3$m!"C1$K%3%M%/%7%g%s$,(B
$B3NN)$5$l$?0lIt$N%Q%1%C%H$N$_5v2D$9$k$@$1$G$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
       
ipchains -A dmz-good -p tcp ! -y -s 192.84.219.128 smtp -j ACCEPT
ipchains -A dmz-good -p udp -s 192.84.219.129 domain -j ACCEPT
ipchains -A dmz-good -p tcp ! -y -s 192.84.219.129 domain -j ACCEPT
ipchains -A dmz-good -p tcp ! -y -s 192.84.218.130 www -j ACCEPT
ipchains -A dmz-good -p tcp ! -y -s 192.84.218.130 rsync -j ACCEPT
ipchains -A dmz-good -p icmp -j icmp-acc
ipchains -A dmz-good -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>DMZ $B$+$i(B BAD ($B30It%M%C%H%o!<%/(B) </H3>

<P>
<UL>
<LI> DMZ $B$KBP$9$k@)8B(B: 
<UL>
<LI> $B%a!<%k%5!<%P(B
<UL>
<LI> <B>$B30It%M%C%H%o!<%/$X$N(B SMTP $B$,2DG=(B</B></LI>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/$+$i$N(B SMTP $B$N%"%/%;%W%H$,2DG=(B</B></LI>
<LI> $B30It%M%C%H%o!<%/$+$i$N(B POP-3 $B$N%"%/%;%W%H$,2DG=(B</LI>
</UL>
</LI>
<LI> $B%M!<%`%5!<%P(B
<UL>
<LI> <B>$B30It%M%C%H%o!<%/$X$N(B DNS $B$NAw?.$,2DG=(B</B></LI>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/(B</B>$B!"%Q%1%C%H%U%#%k%?!<%^%7%s(B<B>$B$+$i(B
$B$N(B DNS $B$N%"%/%;%W%H$,2DG=(B</B></LI>
</UL>
</LI>
<LI> $B%&%'%V%5!<%P(B
<UL>
<LI> $BFbIt$H(B<B>$B30It%M%C%H%o!<%/$+$i$N(B HTTP $B$N%"%/%;%W%H$,2DG=(B</B></LI>
<LI> $BFbIt%M%C%H%o!<%/$+$i$N(B Rsync $B$N%"%/%;%W%H$,2DG=(B</LI>
</UL>
</LI>
</UL>
</LI>
<LI>
<BLOCKQUOTE><CODE>
<PRE>
       
ipchains -A dmz-bad -p tcp -s 192.84.219.128 smtp -j ACCEPT
ipchains -A dmz-bad -p udp -s 192.84.219.129 domain -j ACCEPT
ipchains -A dmz-bad -p tcp -s 192.84.219.129 domain -j ACCEPT
ipchains -A dmz-bad -p tcp ! -y -s 192.84.218.130 www -j ACCEPT
ipchains -A dmz-bad -p icmp -j icmp-acc
ipchains -A dmz-bad -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>BAD ($B30It%M%C%H%o!<%/(B)$B$+$i(B GOOD ($BFbIt%M%C%H%o!<%/(B) </H3>

<P>
<UL>
<LI> $B30It%M%C%H%o!<%/$+$iFbIt%M%C%H%o!<%/$XF~$C$FMh$k$b$NA4$F(B($B%^%9%+(B
$B%l!<%I$5$l$F$$$J$$$b$N(B)$B$r5v2D$7$^$;$s!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -A bad-good -j REJECT
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>Linux $B%^%7%s<+?H$KBP$9$k%Q%1%C%H%U%#%k%?%j%s%0(B</H3>

<P>
<UL>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s<+?H$KF~$C$FMh$k%Q%1%C%C%H$K$b!"%Q%1%C(B
$B%H%U%#%k%?%j%s%0$r9T$$$?$$$J$i!"(Binput $B%A%'%$%s$G%Q%1%C%H%U%#%k(B
$B%?%j%s%0$r9T$&I,MW$,$"$j$^$9!#$"$F@h%$%s%?!<%U%'!<%9Kh$K!"0l$D(B
$B%A%'%$%s$r:n$j$^$9!#(B       
<BLOCKQUOTE><CODE>
<PRE>
       
ipchains -N bad-if
ipchains -N dmz-if
ipchains -N good-if
</PRE>
</CODE></BLOCKQUOTE>


</LI>
<LI> $B:n$C$?%A%'%$%s$K%8%c%s%W$5$;$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
       
ipchains -A input -d 192.84.219.1 -j bad-if
ipchains -A input -d 192.84.219.250 -j dmz-if
ipchains -A input -d 192.168.1.250 -j good-if
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>BAD ($B30It%M%C%H%o!<%/(B) $B%$%s%?!<%U%'!<%9(B</H3>

<P>
<UL>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s(B: 
<UL>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B PING $B$,2DG=(B</B></LI>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B TRACEROUTE $B$,2DG=(B</B></LI>
<LI> DNS $B$X$N%"%/%;%9$,2DG=(B</LI>
</UL>
</LI>
<LI> $B$^$?30It%M%C%H%o!<%/MQ$N%$%s%?!<%U%'!<%9$O!"%^%9%+%l!<%I$5$l$?(B
$B%Q%1%C%H(B($B%^%9%+%l!<%I$O!"%=!<%9%]!<%H$H$7$F(B 61000 $B$+$i(B 65095 $B$r(B
$B;HMQ$7$^$9(B)$B$X$N%j%W%i%$$H(B ICMP $B%(%i!<!"(BPING $B$N%j%W%i%$$b<u$1F~(B
$B$l$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
       
ipchains -A bad-if -i ! ppp0 -j DENY -l
ipchains -A bad-if -p TCP --dport 61000:65095 -j ACCEPT
ipchains -A bad-if -p UDP --dport 61000:65095 -j ACCEPT
ipchains -A bad-if -p ICMP --icmp-type pong -j ACCEPT
ipchains -A bad-if -j icmp-acc
ipchains -A bad-if -j DENY
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>DMZ $B%$%s%?%U%'!<%9(B</H3>

<P>
<UL>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s$KBP$9$k@)8B(B: 
<UL>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B PING $B$,2DG=(B</B></LI>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B TRACEROUTE $B$,2DG=(B</B></LI>
<LI> <B>DNS $B$X$N%"%/%;%9$,2DG=(B</B></LI>
</UL>
</LI>
<LI>DMZ $B%$%s%?!<%U%'!<%9$O!"(BDNS $B$+$i$N%j%W%i%$$H(B ping $B$N%j%W%i%$!"(B
$B%(%i!<(B ICMP $B$r<u$1F~$l$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -A dmz-if -i ! eth0 -j DENY
ipchains -A dmz-if -p TCP ! -y -s 192.84.219.129 53 -j ACCEPT
ipchains -A dmz-if -p UDP -s 192.84.219.129 53 -j ACCEPT
ipchains -A dmz-if -p ICMP --icmp-type pong -j ACCEPT
ipchains -A dmz-if -j icmp-acc
ipchains -A dmz-if -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H3>GOOD ($BFbIt%M%C%H%o!<%/(B)$B%$%s%?!<%U%'!<%9(B</H3>

<P>
<UL>
<LI> $B%Q%1%C%H%U%#%k%?!<%^%7%s$KBP$9$k@)8B(B: 
<UL>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B PING $B$,2DG=(B</B></LI>
<LI> <B>$BA4$F$N%M%C%H%o!<%/$KBP$7$F(B TRACEROUTE $B$,2DG=(B</B></LI>
<LI> <B>DNS $B$X$N%"%/%;%9$,2DG=(B</B></LI>
</UL>
</LI>
<LI>$BFbIt%M%C%H%o!<%/$KBP$9$k@)8B(B: 
<UL>
<LI> $B30It%M%C%H%o!<%/$X$N(B WWW, ftp ,traceroute, ssh $B$r5v2D$9$k(B</LI>
<LI> $B%a!<%k%5!<%P$X$N(B SMTP $B$r5v2D$9$k(B</LI>
<LI> $B%a!<%k%5!<%P$X$N(B POP-3 $B$r5v2D$9$k(B</LI>
<LI> $B%M!<%`%5!<%P$X$N(B DNS $B$r5v2D$9$k(B</LI>
<LI> $B%&%'%V%5!<%P$X$N(B rsync $B$r5v2D$9$k(B</LI>
<LI> $B%&%'%V%5!<%P$X$N(B WWW $B$r5v2D$9$k(B</LI>
<LI> <B>$B%Q%1%C%H%U%#%k%?!<%^%7%s$X$N(B ping $B$r5v2D$9$k(B</B></LI>
</UL>
</LI>
<LI>$BFbIt%M%C%H%o!<%/%$%s%?!<%U%'!<%9$O!"(Bping $B$H(B ping $B$N%j%W%i%$!"(B
$B%(%i!<(B ICMP $B$r<u$1F~$l$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -A good-if -i ! eth1 -j DENY
ipchains -A good-if -p ICMP --icmp-type ping -j ACCEPT
ipchains -A good-if -p ICMP --icmp-type pong -j ACCEPT
ipchains -A good-if -j icmp-acc
ipchains -A good-if -j DENY -l
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>


<H2><A NAME="ss7.5">7.5</A> <A HREF="IPCHAINS-HOWTO.html#toc7.5">$B:G8e$K(B</A>
</H2>

<P>
<UL>
<LI>$B%V%m%C%-%s%0$N%k!<%k$r:o=|$7$^$9!#(B
<BLOCKQUOTE><CODE>
<PRE>
ipchains -D input 1
ipchains -D forward 1
ipchains -D output 1
</PRE>
</CODE></BLOCKQUOTE>
</LI>
</UL>
</P>



<HR>
<A HREF="IPCHAINS-HOWTO-8.html">$B<!$N%Z!<%8(B</A>
<A HREF="IPCHAINS-HOWTO-6.html">$BA0$N%Z!<%8(B</A>
<A HREF="IPCHAINS-HOWTO.html#toc7">$BL\<!$X(B</A>
</BODY>
</HTML>