<!doctype linuxdoctr system>

<article>
<title>Firewall And Proxy Server HOWTO</title>
<author>Mark Grennan,
<tt>mark@grennan.com</tt>
<date>v0.83, August 21, 2000

<trans>日本語訳: JF Project (<tt>jf@linux.or.jp</tt>)
<tdate>v1.0.0j  Sep. 22, 2001

<abstract> 
<!--
This document is designed to describe the basics of firewall systems and give you some detail on setting up both a filtering and proxy firewall on a Linux based system. An HTML version of this document is available at <em>http://www.grennan.com/Firewall-HOWTO.html</em> 
-->
この文書はファイアウォールの基礎を説明すると共に、 Linux ベースの
システムでフィルタ及びプロキシファイアウォールを構築するための詳細な情報を、
幾つか紹介します。
この文書の HTML バージョンは <em>http://www.grennan.com/Firewall-HOWTO.html</em> にあります。
</abstract>

<toc>
<!-- (1) -->
<!--
<sect>Introduction
-->
<sect>紹介
<p>
<!--
David Rudder wrote this original version of this Firewall-HOWTO, now over four years ago, and I'd still like to thank him for allowing me to update his work.

I'd also like to thank Ian Gough for kindly assisting a this dislexic writer.
-->
David Rudder さんがこの Firewall-HOWTO のオリジナルの文書を書きました。
4年前、そして今も作品を引き継ぐことを許してくれた彼に感謝します。

<!--
I'd also like to thank Ian Gough for kindly assisting a this dislexic writer.
-->
親切にも、この失読症の筆者を手伝ってくれた Ian Gough さんにも感謝します。
<!-- 
dislexic は、 dyslexic の typo だと思います。
辞書によると dyslexic は「難読症の人」とあります。(水原さん)
 -->

<!--
Firewalls have gained great popularity as the ultimate in Internet Security. Today firewalls are a part of almost every networking device. Like most hot subject they are also often misunderstood.  This HOWTO will go over the basics of what a firewall is and how to set one up.
-->
ファイアウォールは、今までインターネット上での究極のセキュリティと
しての地位を得て来ました。
今日、ファイアウォールは殆どのネットワークデバイスの一部になって
います。
他の最新の話題と同様、しばしば誤解されがちです。
この文書では、ファイアウォールの実体と、構築方法を見ていきます。

<!--
I am using kernel 2.2.14 and RedHat 6.1 to develop this howto so the examples here are based on this distribution. If you find differences in your distribution, please email me and I'll update this howto.
-->
私はカーネル 2.2.14 と RedHat 6.1 をこの文書の作成に使っており、
それ故に文中の例はこのディストリビューションを元にしております。
もし、あなたのディストリビューションとの相違点がありましたら、
email をください。この howto を更新します。

<!--
<sect1>Feedback
-->
<sect1>フィードバック

<p>
<!--
Any feedback is very welcome. <bf>PLEASE REPORT ANY INACCURACIES IN THIS PAPER!!!</bf>  I am human, and prone to making mistakes.  If you find a fix for anything please send it to me.  I will try to answer all e-mail, but I am busy, so don't get insulted if I don't.
-->
どんなフィードバックでも歓迎します。 <bf>この文書の間違いを教えて
ください!!</bf>
私は人間ですから間違いをしがちです。
何か間違いを見つけたら私に知らせてください。
全ての e-mail に返答したいのはやまやまなのですが、忙しいので、
返事をしなくても怒らないでください。

<!--
<em>My email address is <bf><url url="mailto:mark@grennan.com" name = "mark@grennan.com"></bf></em>
-->
<em>私の email アドレスは <bf><url url=":mailto:mark@grennan.com" name="mark@grennan.com"> です。</bf></em>

<!--
<sect1>Disclaimer 
-->
<sect1>責任放棄

<p> 
<!--
<bf>Times have changes. This section did say "I am not, nor do it pretend to be, a security expert."  Now I am one. My offical title is Security Analist. So maybe I know something about what I write.  But please, I am writing this to help people get aquainted with this subject. I am not ready to stake my life on the accuracy of this document.  If all you know about firewalls is based on this document, don't stake your job on your firewall.  I AM NOT RESPONSIBLE FOR ANY DAMAGES INCURRED DUE TO ACTIONS TAKEN BASED ON THIS DOCUMENT</bf>. 
-->
<bf>時が経ちました。
この部分は以前は、``私はセキュリティーのエキスパートではなく、また、
そうなる気もありません。'' となっていました。
今や、私はエキスパートになってしまいました．
私の公式の肩書はセキュリティーアナリストです。
もしかすると、私は、以前より少しはまともな事を書いているかもしれません。
でもわかって欲しいのは、この文書はあくまでも皆さんがこの分野を探求する
際の助けになることを目指しているものなのです。
私はこの文書の精度を上げる為に自分の人生を賭けるつもりはありません。
もし、あなたのファイアウォールの知識の全てがこの文書に基づくもので
あるならば、仕事をファイアウォールに賭けないでください。
私は、この文書に基づいた行動で負った全ての損害に対しての責任を
負いません。</bf>

<!--
<sect1>Copyright
 -->
<sect1>著作権

<p> 
<!--
Unless otherwise stated, Linux HOWTO documents are copyrighted by their respective authors. Thats me. Linux HOWTO documents MAY (even should) be reproduced and distributed in whole or even in part, in as may mediums, physical or electronic, as long as this copyright notice is retained on all copies. Commercial redistribution is allowed and encouraged.  
-->
特に記述が無い限り、 Linux HOWTO 文書は、それぞれの著者に著作権が有ります。
それは私です。
Linux HOWTO 文書は、この著作権表示が入っているならば、一部または全部を
再編集し、電子的或は物理的な方法にかかわらず配布することができます
(むしろ、それが望ましい)。
商用配布も歓迎されます。

<!--
Please email me if you do us this work in any distribution.  (I like to find my name in print)
-->
もし、この文書を配布する場合は、私にメールで知らせてください。
(印刷物に自分の名があるのを見るのが好きなもので)。

<!--
All translations, derivative works, or aggregate works incorporating any Linux HOWTO documents must be covered under this copyright notice. That is, you may not impose additional restrictions on its distribution. Exceptions to these rules may be granted under certain conditions; please contact the Linux HOWTO coordinator.
-->
翻訳や、派生した作品、Linux HOWTO 文書への集約はこの著作権表示に
したがって行わなければなりません。
これは、配布物に新たな制限を追加してはいけないということです。
このルールに沿っていることを確信できる場合以外は、Linux HOWTO
コーディネータに連絡を取ってください。

<!--
In short, we wish to promote dissemination of this information through as many channels as possible. However, we do wish to retain copyright on the HOWTO documents, and would like to be notified of any plans to redistribute the HOWTOs but you can do it without asking so long as this Copyright statment remains.
-->
要するに、我々は可能な限りの手段を通じて、この情報が広く行き渡ることを
望んでいます。
しかし、我々は HOWTO ドキュメントの著作権を保持したいと共に、再配布の
計画を知らされたいとも思っています。
ただ、この著作権表記を残していれば、質問等なしに使ってかまいません。

<!--
If you have any questions, please email me. (See Above)
-->
何か疑問がありましたら、私にメールで知らせてください。(上記参照のこと)

<!--
<sect1>My Reasons for Writing this
-->
<sect1>この文書を書く理由

<p>
<!--
Several years ago, while working for the State of Oklahoma as their &dquot;Internet Administrator&dquot; I was ask to &dquot;put the State on the Internet&dquot;, with no budget. (Note: There was no such title at the time.  I was just the guy doing all the work.) The best way to make this happen was to use as much free software and junk hardware as I could.  Linux and a bunch of old 486s were all I had to work with.
-->
数年前、オクラホマ州で&dquot;インターネット管理者&dquot;として
働いていたときに、ただで&dquot;州をインターネットにつなげてくれ&dquot;と
頼まれました。 (注意: そのときは、そのような肩書きはありませんでした。
私はただの単なる何でも屋だったのです。)
これを実現する最良の方法は、可能な限りの多数のフリーソフトと
ジャンクハードウェアを使うことでした。
Linux と、沢山の古い 486 マシンだけが、実現させるための道具でした。

<!--
Linux was my only hope. At the time (and even now) commercial firewalls are where every expensive. All the documentation I could find on how they work is considered almost top secret. As a result, I found creating a firewall of my own was almost impossible.
-->
Linux だけが希望でした。
当時 (そして今も) 、商用のファイアウォールはどこでも高価な物です。
私が見つけた、全てのファイアウォールの動作を詳述した文書は、その殆どが
最高機密でした。
その結果、ファイアウォールを自らの手で作り上げるのは殆ど不可能なのだと
思いました。

<!--
At my next job with American Floral Services (AFS), I was asked to put in a firewall and Linux had just added firewall code in the kernal.  So again, with no budget, I started building a firewall with Linux. Six months later my firewall was in place and this document was updated.
-->
次の American Floral Services (AFS) では、ファイアウォールを
動かすことを頼まれ、その時点ではファイアウォールのソースコードが
カーネルに組み込まれていました。
そして再び、ただで Linux を使ってファイアウォールを建てました。
六ヶ月後、ファイアウォールは完成し、この文書が更新されました。

<!--
Now, six years latter, I have worked with lots of firewalls. CheckPoint Firewall-1, Cisco Pix, lots of simple router firewalls and every version of Linux based firewall there is. I consider Linux the best firewall there is. But it may be the most complex to setup.
-->
今、あれから6年を経て、私は沢山のファイアウォールで仕事をしています。
例えば CheckPoint Firewall-1, Cisco Pix, そして沢山の
ルータのファイアウォールと、全てのバージョンの Linux ベースの
ファイアウォールです。
私は、 Linux が現在の最良のファイアウォールだと思います。
でも、その設定は最も複雑なものであるかもしれません。

<!--
<sect1>Further Readings
-->
<sect1>更に読みたい人は

<p>
<!--
<itemize>
<item><url url="http://sunsite.unc.edu/mdw/HOWTO/Networking-Overview-HOWTO.html" name="The The Linux Networking Overview HOWTO"> 

<item><url url="http://sunsite.unc.edu/mdw/HOWTO/Ethernet-HOWTO.html" name="The Ethernet HOWTO"> 

<item><url url="http://ipchains.nerdherd.org/" name="IPchains Firewalling made Easy!"> 

<item><url url="http://www.linas.org/linux/load.html" name="Linux Network Address Translation"> 

<item><url url="http://metalab.unc.edu/mdw/HOWTO/Net-HOWTO/index.html" name="The Net-HOWTO"> 

<item><url url="http://metalab.unc.edu/mdw/HOWTO/PPP-HOWTO/index.html" name="The NET-PPP HOWTO"> 

<item><url url="http://www.freeswan.org/" name="Software to build secure VPNs across public networks">

<item><url url="http://icarus.autostock.co.kr/" name="GFCC a GTK+ Firewall Control Center">

<item><url url="http://freshmeat.net/projects/icq-proxy/homepage/" name="This is a port forwarding proxy for ICQ clients, allowing direct connection (chat, file transfer) from behind a firewall. (My wife gave me hell untill I found this.)">

<item><url url="http://freshmeat.net/projects/linuxvpnmasquerade/homepage/" name="This site describes how to se an IPSec or PPTP VPN host (client or server) behind a Linux masquerading firewall.">

<item><url url="http://freshmeat.net/projects/rc.firewall/download/" name="rc.firewall is an ipchains-based firewall script with extensive support for network services (including NFS, IPSec VPNs, Proxies, etc.), masquerading, port forwarding, and IP accounting. Protections include spoofing, stuffed routing/masqerading, DoS, smurf attacks, outgoing port scans, and much more. Multiple private and public interfaces are also supported.">

<item><url url="http://www.squid-cache.org/" name="The Best proxy server bar none."

<item><url url="http://freshmeat.net/projects/socks5/homepage/" name="An oldy but a goodie. Find the lattest version of the socks proxy here">

</itemize>
-->
<itemize>
<item><url url="http://sunsite.unc.edu/mdw/HOWTO/Networking-Overview-HOWTO.html" name="The Linux Networking Overview HOWTO"> 

<item><url url="http://sunsite.unc.edu/mdw/HOWTO/Ethernet-HOWTO.html" name="The Ethernet HOWTO"> 

<item><url url="http://ipchains.nerdherd.org/" name="IPchains Firewalling made Easy!"> 
【訳注: 上記 URI は無効です。】

<item><url url="http://www.linas.org/linux/load.html" name="Linux Network Address Translation"> 

<item><url url="http://metalab.unc.edu/mdw/HOWTO/Net-HOWTO/index.html" name="The Net-HOWTO"> 

<item><url url="http://metalab.unc.edu/mdw/HOWTO/PPP-HOWTO/index.html" name="The NET-PPP HOWTO"> 

<item><url url="http://www.freeswan.org/" name="Software to build secure VPNs across public networks">

<item><url url="http://icarus.autostock.co.kr/" name="GFCC a GTK+ Firewall Control Center">

<item><url url="http://freshmeat.net/projects/icq-proxy/homepage/" 
name="これはファイアウォールの後ろから ICQ の接続
(チャット、ファイルの送受信) を実現する、ポートフォワーディングプロキシです。
(私がこれを見つけるまで妻が私を不快にしてくれました。) ">

<item><url url="http://freshmeat.net/projects/linuxvpnmasquerade/homepage/" 
name="このサイトは Linux の IP Masquerading ファイアウォールの後ろにある
IPSec や PPTP VPN のホスト (クライアントやサーバ) にアクセスする方法を
解説しています。">

<item><url url="http://freshmeat.net/projects/rc.firewall/download/" 
name="rc.firewall は、膨大なネットワークサービス
(NFS, IPSec, VPNs, Proxies等) や、マスカレーディング、 
ポートフォワーディング、 IP アカウンティングをサポートする、
ipchains ベースのファイアウォールスクリプトです。
スプーフィング【訳注: 偽装】、偽装ルーティング/マスカレーディング、
DoS 【訳注: Denial of Service: サービス不能攻撃】、
smurf 攻撃、発信ポートスキャン、等々から守ります。
複数のプライベート及び公共インターフェースもサポートされています。">
<p>
【訳注: 上記 URI は無効です。
現在は、 <url url="http://rcf.mvlan.net/" name="rcf">
に変更されています。】
<p>
【訳注: &quot;smurf&quot; とは、 DoS 攻撃の一種を行う
攻撃プログラムの名前です。
詳しくは、
<url url="http://www.cert.org/advisories/CA-1998-01.html" 
name="CERT の文書"> や、
<url url="http://isl.educ.fukushima-u.ac.jp/~shinoda/net-docs/CERT/CA-98.01.smurf.html"
name="CERT の文書の日本語訳"> 等を参照してください。】

<item><url url="http://www.squid-cache.org/" name="間違いなく最良のプロキシサーバです。">

<item><url url="http://freshmeat.net/projects/socks5/homepage/" name="古いですが、いい物です。 Socksの最新バージョンがここにあります。">

<!--以上、ここまで皆川哲朗jn7vvc@hkg.odn.ne.jpが翻訳-->

</itemize>
<!-- (2) -->
<!-- 
<SECT>Understanding Firewalls
 -->
<SECT>ファイアウォールを理解する

<p>
<!-- 
A firewall is a structure intended to keep a fire from spreading.  Building have firewalls made of brick walls completely dividing sections of the building. In a car a firewall is the metal wall separating the engine and passenger compartments.
 -->
防火壁とは、延焼を避けることを意図した建築構造です。
建築物には煉瓦でできた防火壁があり、建築物の区画を完全に分離します。
車の防火壁は金属性の壁で、エンジンと乗客の室内とを区切ります。

<!-- 
Internet firewalls are intended to keep the flames of Internet hell out of your private LAN. Or, to keep the members of your LAN pure and chaste by denying them access the all the evil Internet temptations. ;-)
 -->
インターネットのファイアウォールは、あなたのプライベート LAN に
インターネットの地獄の炎を侵入させないことを意図しています。
或は、あなたの LAN 内のメンバーが、邪悪なインターネット上の誘惑に対して行う
アクセスを禁止し、彼らを純粋且つ純潔に保つためのものです。 ;-)

<!-- 
The first computer firewall was a non-routing Unix host with connections to two different networks. One network card connected to the Internet and the other to the private LAN. To reach the Internet from the private network, you had to logon to the firewall (Unix) server.  You then used the resources of the system to access the Internet. For example, you could use X-windows to run Netscape's browser on the firewall system and have the display on your work station. With the browser running on the firewall it has access to both networks.
 -->

初期のコンピュータファイアウォールは、二つの異なるネットワークに
接続されている、経路制御を行わない Unix ホストでした。
片方のネットワークカードはインターネットに接続され、もう片方は
プライベート LAN に接続されていました。
プライベートネットワークからインターネットへ到達するには、
ファイアウォール (Unix) サーバにログオンしなければなりませんでした。
次にインターネットにアクセスする為にそのサーバのリソースを使います。
例えば、ファイアウォールシステム上の Netscape のブラウザを動作させて、
あなたのマシン上で動作する X Window System のディスプレイ上に表示できます。
ファイアウォール上で動作するブラウザは両方のネットワークにアクセス
できます。

【訳注: このエピソードについては、例えば 
<url url="http://www.delegate.org/" name="Delegate">
の
<url url="http://www.delegate.org/ftp/pub/DeleGate/doc/History-199801-ja.txt" name="History of development">
にてもかいま見ることができます。】

<!-- 
This sort of dual homed system (a system with two network connections) is great if you can TRUST ALL of your users. You can simple setup a Linux system and give an account accounts on it to everyone needing Internet access. With this setup, the only computer on your private network that knows anything about the outside world is the firewall. No one can download to their personal workstations. They must first download a file to the firewall and then download the file from the firewall to their workstation. 
 -->
この類の「デュアルホームシステム (dual homed system)」
(2つのネットワークに接続されているシステム) は、あなたのネットワーク上の
ユーザ全てが信頼できるなら、それは素晴らしいものです。
単純に Linux システムをセットアップして、インターネットへアクセスしたい
人全てにアカウントを発行すれば良いのですから。
この設定によって、あなたのプライベートネットワーク上にあって、
外の世界についてあらゆることを知るコンピュータは、ファイアウォールだけと
なります。
プライベートネットワーク内の人は誰も自分自身のワークステーションへ
インターネットから直接ダウンロードすることはできません。
最初にインターネットからファイアウォールへファイルをダウンロードしてから、
次にファイアウォールから自分自身のワークステーションへダウンロード
しなければなりません。

<!-- 
BIG NOTE: 99% of all break-ins start with gaining account level access on the system being attacked.  Because of this I don't recommend this type of firewall.  It is also very limiting.
 -->
最重要 - 全ての侵入の 99% は、攻撃対象のシステムに対してアカウントレベルの
アクセスを得ることから始まります。
ですので、この種のファイアウォールはお薦めしません。
また、このファイアウォールは制限もきつ過ぎます。

<!-- 
<sect1>Firewall Politics
 -->
<sect1>ファイアウォールのポリシー

<p> 
<!-- 
You shouldn't believe a firewall machine is all you need.  <em>Set policies first</em>.
 -->
ファイアウォールマシンこそあなたが望むものの全てであると信じるべきではありません。
<em>先ず、ポリシーを設定しましょう</em>。

<!--
Firewalls are used for two purposes. 
 -->
ファイアウォールは 2つの用途に使われます。

<!-- 
<enum> 
<item> to keep people (worms / crackers) out. 
<item> to keep people (employees / children) in. 
</enum>
 -->
<enum> 
<item> 人 (ワーム / クラッカー) を締め出す為。
<item> 人 (従業員 / 子供達) を閉じ込める為。
</enum>

<!-- 
When I started working on firewalls I was surprised to learn the company I worked for were more interested in &dquot;spying&dquot; on their employees then keeping crackers out of their networks.
 -->
私がファイアウォールに取り組んでいた頃、私が働いていた会社は彼らの
ネットワークからクラッカーを締め出すことよりも、従業員をスパイ
することにより興味を持っていたことにとても驚きました。
<!-- 
more insterested in
の後なので、多分
on their employees than keeping
ではないかと想像します。(松田)
 -->

<!-- 
At least in my state (Oklahoma) employers have the right to monitor phone calls and Internet activity as long as they inform the employees they are doing it.
 -->
少なくとも私の州 (オクラホマ) では、雇用者は従業員に断りさえすれば、
彼らの電話の会話とインターネットの利用状況を監視する権利を持っていました。

<!-- 
Big Brother is not government. Big Brother = Big Business. 
 -->
独裁的だったのは政府ではなく、巨大企業だったのです。

<!-- 
Don't get me wrong. People should work, not play, at work. And I feel the work ethic has been eroding.  However, I have also observed that "management types" are the biggest abusers of the rules they set. I have seen hourly workers reprimanded for using the Internet to look for bus routes to work and the same manager useing hours of work time surffing for fine restaurants and nightclubs to take prospective customers.
 -->
誤解しないでください。
人々は勤務時間中は働いていて、遊んではいなかった筈です。
そして私は勤務倫理が蝕まれることを感じていました。
しかしながら、私はまた"管理者側"こそ彼らが設定したルールの最も悪質な
権利乱用者であることを監視していました。
通勤バスの経路を探す為にインターネットを使ったことで時間給労働者が
経営者に懲戒されたと同時に、まさにその懲戒を行った経営者が、見込みのある
顧客を連れていくための上等なレストランやナイトクラブを、
勤務時間中に何時間もネットサーフィンしていたのを見てきました。

<!-- 
I somewhat understand management spying on the work force to find who is looking for a job a Monster.com. But I find it unethical when a manager passes over an employee for a promossion because s/he has been visiting health care sites and "May have Aids".
 -->
勤務上の管理の為のスパイ行為は、 Monster.com で仕事探しをしている人を
見つけることでもありました。
でも、私は経営者が労働者の昇格条件に "エイズにかかっているかも知れない"
かどうかをチェックする為に彼/彼女が健康管理サイトに訪れたことがあるか
否かを見ている時に、これは非倫理的であることに気付きました。

<!-- 
But I find it unethical when a manager passes over an employee for a promossion because s/he has been visiting health care sites and "May have Aids".
いまいち意味が通り難いので、かなり意訳してしまいました。(松田)
 -->

<!-- 
The security business can be scary. If you are the firewall manager, watch your back. 
 -->
セキュリティの仕事は恐ろしいことになりかねません。
もしあなたがファイアウォールの管理者なら、あなたの背後にご注意あれ。

<!-- 
<sect2>How it create a security policy
 -->
<sect2>セキュリティポリシーの作成方法

<p>
<!-- 
I have seen some realy high folutin documentation on how to create a security policy.  Don't believe a word of them. Create a security policy is simple.
 -->
私は今までセキュリティポリシーの作成方法に関する「ホントに仰々しい」
文書を幾つか見てきました。
そんなのを信じてはいけません。
セキュリティポリシーを作ることはとても単純なのです。

<P>
<!-- 
<enum>
<item> describe what you are suppling
<item> describe the group of people you are providing services to
<item> describe which service each group needs access to
<item> for each service group describe how the service should be keep secure
<item> write a statment making all other forms of access a security vialation
</enum>
 -->
<enum>
<item> 与えるものを書き出す
<item> あなたがサービスを提供する人のグループを書き出す
<item> 各々のグループが必要とするアクセスはどのサービスなのかを書き出す
<item> 各々のグループへのサービス毎に、どのように安全を確保するかを書き出す
<item> 他のかたちを取るアクセスは、全てセキュリティ違反である旨の宣言文を書く
</enum>
<!-- 
Your policy will become more complicated with time but don't try to cover to much ground now.  Make it simple and clear.
 -->
あなたのポリシーは時と共により複雑になるでしょうけれども、
何もかもをカバーしようとはしないでください。
単純で明解にすることを心がけてください。

<!-- 
<sect1>Types of Firewalls
 -->
<sect1>ファイアウォールの種類

<p>
<!-- 
There are two types of firewalls.
 -->
ファイアウォールには 2 種類あります。

<!-- 
<enum>
<item>Filtering Firewalls - that block selected network packets. 
<item>Proxy Servers (sometimes called firewalls) - that make network 
connections for you.
</enum>
 -->
<enum>
<item>フィルタリングファイアウォール - 選択したネットワークパケットを
ブロックします。
<item>プロキシサーバ (しばしばファイアウォールと呼ばれます) - ネットワークへの接続を提供します。
</enum>
<!-- 
「プロクシ」なのか「プロキシ」なのかで迷いましたが、 JF の検索で
より多くヒットした方にひよりました。(笑)(松田)
 -->

<!-- 
<sect2>Packet Filtering Firewalls
 -->
<sect2>パケットフィルタリングファイアウォール

<p>
<!-- 
Packet Filtering is the type of firewall built into the Linux kernel.
 -->
パケットフィルタリングは Linux カーネルに組み込まれるタイプの
ファイアウォールです。

<!-- 
A filtering firewall works at the network level. Data is only allowed to leave the system if the firewall rules allow it.  As packets arrive they are filtered by their type, source address, destination address, and port information contained in each packet.
 -->
フィルタリングファイアウォールはネットワークレベルで動作します。
ファイアウォールルールが許可した時だけ、データはシステムから
出ていくことを許されます。
到達したパケットは、各々のパケットに含まれている種類、発信アドレス、
宛先アドレス、そしてポートの情報によってフィルタリングされます。

<!-- 
Many network routers have the ability to perform some firewall services. Filtering firewalls can be thought of as a type of router. Because of this you need a deep understanding of IP packet structure to work with one.
 -->
多くのネットワークルータはある程度のファイアウォールサービスを
実現する機能を持っています。
フィルタリングファイアウォールはそれらの類のルータと同等と考えられます。
このため、これを動作させるにあたって IP パケットの構造に対する
深い理解を必要とします。

<!-- 
Because very little data is analyzed and logged, filtering firewalls take less CPU and create less latency in your network.
 -->
解析・記録されるデータは非常に小さいので、フィルタリングファイアウォールは
CPU 負荷を殆ど必要としませんし、ネットワークの遅延も殆ど生じません。

<!-- 
Filtering firewalls do not provide for password controls. User can not identify themselves. The only identity a user has is the IP number assigned to their workstation. This can be a problem if you are going to use DHCP (Dynamic IP assignments). This is because rules are based on IP numbers you will have to adjust the rules as new IP numbers are assigned.  I don't know how to automate this process. 
 -->
フィルタリングファイアウォールはパスワード制御を行いません。
ユーザは自分を認証させることはできません。
ユーザを識別する唯一の方法は、ワークステーションに割り当てられた
IP アドレスです。
このことは DHCP (Dynamic IP assignments: 動的 IP 割り当て) の使用を
意図している場合に問題をひき起こす可能性があります。
ルールは IP アドレスを手がかりにしているので、新たな IP アドレスが
割り当てられる度毎にルールを調整しなければならなくなります。
私はこれを自動化する術を知りません。

<!-- 
Filtering firewalls are more transparent to the user.  The user does not have to setup rules in their applications to use the Internet. With most proxy servers this is not true.
 -->
フィルタリングファイアウォールはユーザにとってより透過的です。
ユーザはインターネットへアクセスする為に使用するアプリケーションに
ルールを設定する必要がありません。
殆どのプロキシサーバでは設定の必要があります。

<!-- 
<sect2>Proxy Servers
 -->
<sect2>プロキシサーバ

<p> 
<!-- 
Proxies are mostly used to control, or monitor, outbound traffic. Some application proxies cache the requested data. This lowers bandwidth requirements and decreases the access the same data for the next user.  It also gives unquestionable evidence of what was transferred.
 -->
プロキシは殆どの場合、外部へのトラフィックを制御または監視する為に
使われます。
要求されたデータをキャッシュするアプリケーションプロキシも存在します。
このことによって必要とされるネットワークのバンド幅を低下させ、
次のユーザに対して同じデータへのアクセスを低下させます。
それと共に何が転送されたのかを動かぬ証拠として提供します。

<!-- 
There are two types of proxy servers. 
 -->
プロキシサーバには 2種類あります。
<!-- 
<enum>
<item>Application Proxies - that do the work for you.
<item>SOCKS Proxies  - that cross wire ports.
</enum>
 -->
<enum>
<item>アプリケーションプロキシ - あなたの為に仕事をしてくれます。
<item>SOCKS プロキシ  - クロスワイヤポートです。
</enum>

<!-- 
<sect2>Application Proxy
 -->
<sect2>アプリケーションプロキシ

<p>
<!-- 
The best example is a person telneting to another computer and then telneting from there to the outside world. With a application proxy server the process is automated. As you telnet to the outside world the 
client send you to the proxy first. The proxy then connects to the server you requested (the outside world) and returns the data to you.
 -->
最も良い例は、ある人が他のコンピュータへ telnet 接続してから、その
コンピュータから外界へ telnet 接続することです。
アプリケーションプロキシサーバは、この手順を自動化します。
あなたが外界へ telnet 接続すると、先ずクライアントはあなたをプロキシへ
送り出します。
プロキシは次にあなたが要求する (外界の) サーバへ接続し、データをあなたへ
返します。

<!-- 
Because proxy servers are handling all the communications, they can log everything they (you) do. For HTTP (web) proxies this includes very URL they you see.  For FTP proxies this includes every file you download. They can even filter out &dquot;inappropriate&dquot; words from the sites you visit or scan for viruses.
 -->
プロキシサーバは全ての接続を処理するので、(あなたを含めて)アクセスする
全ての挙動をログ記録することができます。
HTTP (web) プロキシにおいては、あなたが閲覧するサイトの URL そのものが
含まれます。
FTP プロキシにおいては、あなたがダウンロードした全てのファイルが含まれます。
あなたが訪れるサイトから &dquot;不適当な&dquot; 言葉さえも排除したり、
ウィルススキャンもできます。

<!-- 
Application proxy servers can authenticate users. Before a connection to the outside is made, the server can ask the user to login first. To a web user this would make every site look like it required a login.
 -->
アプリケーションプロキシサーバはユーザ認証ができます。
外からの接続が行われる前に、サーバはユーザに対して最初にログインを催促します。
web ユーザにおいては、全てのサイトにおいてログインを要求されるように見えます。

<!-- 
<sect2>SOCKS Proxy
 -->
<sect2>SOCKS プロキシ

<p> 
<!-- 
A SOCKS server is a lot like an old switch board.  It simply cross wires your connection through the system to another outside connection.  
 -->
SOCKS サーバは旧型のスイッチボードに大変良く似ています。
これは単に、あなたの接続を別の外部の接続にシステム上で繋ぎ換えます。

<!-- 
Most SOCKS server only work with TCP type connections.  And like filtering firewalls they don't provide for user authentication. They can however record where each user connected to. 
 -->
殆どの SOCKS サーバは TCP タイプの接続でのみ動作します。
そしてフィルタリングファイアウォールと同様、ユーザ認証の機能は
装備されていません。
しかしながら、ユーザがどこに接続したのかを記録することはできます。

<!-- (3) -->
<!-- 
<sect>Firewall Architecture 
 -->
<sect>ファイアウォールのアーキテクチャ(基本設計)
<!-- 
「アーキテクチャ」という言葉を採用している HOWTO が非常に多かったのですが、
私のような英語を不得意とする者としてはなんとなく曖昧に捉えられかねないと
思ったので、敢えて(基本設計)と付け加えてみました。
この「基本設計」という言葉を使っている HOWTO も少ないながらありました。(松田)
 -->

<p>
<!-- 
There are lots of ways to structure your network to protect your  systems using a firewall.  
 -->
ファイアウォールを用いてシステムを防御するようなネットワーク構成には、
様々な種類があります。

<!-- 
If you have a dedicated connections to the Internet through a router, you could plug the router directly into your firewall system. Or, you could go through a hub to provide for full access servers outside your firewall.
 -->
ルータを通じてインターネットへ専用線接続しているなら、
ルータを直接ファイアウォールシステムに接続してもいいでしょう。
あるいはハブをかませてファイアウォールの外側にサーバ群を置き、
それらにフルアクセスを提供するかたちでもいいでしょう。

<!--
うーん、「フルアクセス」で意味が通るでしょうか?自信ないです。(松田)
 -->
<!-- 
<sect1> Dial-up Architecture
 -->
<sect1> ダイヤルアップアーキテクチャ

<p>
<!-- 
You may be using a dialup service like an ISDN line.  In this case you might use a third network card to provide provide a filtered DMZ. This gives you full control over your Internet services and still separates them from your regular network.  
 -->
きっと読者は ISDN 回線のようなダイヤルアップサービスを利用している
ことでしょう。
この場合、第三のネットワークカードを用いてフィルタリングされた DMZ
【訳注: Demilitarized Zone: 非武装化地帯】を作り出すのもいいかもしれません。
こうすればインターネットサービスを完全にコントロールできますし、
かつそれらを通常のネットワークからは切り離しておけます。

<!--
<verb>
                  __________
   _/\__/\_      |          |          _______________
  |        |     | Firewall |  (LAN)  |               |
 / Internet \-&#54;-&#54;|  System  |-&#54;(HUB)-&#54;| Workstation/s |
 \_  _  _  _/    |__________|         |_______________|
   \/ \/ \/           |
                    (DMZ)
                    (HUB)
</verb>
 -->
<verb>
                  __________
   _/\__/\_      | ファイア |           __________________
  |インター|     | ウォール |  (LAN)   |                  |
 /  ネット  \----| システム |--(ハブ)--|ワークステーション|
 \_  _  _  _/    |__________|          |__________________|
   \/ \/ \/           |
                    (DMZ)
                    (ハブ)
</verb>
<!-- 
Windows 系OSですと、バックスラッシュは￥マークになってしまいます。
かと言って、JISアートにすると、 Mozilla/MSIE 等で表示がガタつきます。
日本語訳した時点でガタついてしまうのですが…どうすれば良いでしょう?(松田)
 -->

<!-- 
<sect1> Single Router Architecture
 -->
<sect1> 単一のルータのアーキテクチャ

<P>
<!-- 
If there is a router or cable modem between you and the Internet. If you own the router you could setup some hard filter rules in the router. If this router is owned by your ISP so you may not the have the needed controls. You can ask your ISP to put in filters. 
 -->
あなたのマシンとインターネットの間にルータやケーブルモデムがある場合を
考えましょう。
そのルータがあなたの所有物なら、そのルータに強固なフィルタルールを
設定できるでしょう。
ルータが ISP の所有なら、必要なコントロールを行うことは多分できないでしょう。
ISP にフィルタを設定するように頼むことはできるかもしれません。

<!--
<verb>
                  _________           __________
   _/\__/\_      | Router  |         |          |          _______________
  |        |     |   or    |  (DMZ)  | Firewall |  (LAN)  |               |
 / Internet \-&#54;-&#54;|Cable Mdm|-&#54;(HUB)-&#54;|  System  |-&#54;(HUB)-&#54;| Workstation/s |
 \_  _  _  _/    |_________|    |    |__________|         |_______________|
   \/ \/ \/                     |  
                            (Outside)    
                            (Server)
</verb>
 -->
<verb>
                  _________            __________
   _/\__/\_      | ルータ  |          | ファイア |           _______________
  |インター|     |  又は   |  (DMZ)   | ウォール |  (LAN)   |    ワーク     |
 /  ネット  \----|ケーブル |--(ハブ)--| システム |--(ハブ)--|  ステーション |
 \_  _  _  _/    | モデム  |    |     |__________|          |_______________|
   \/ \/ \/      |_________|    |  
                              (外部)    
                             (サーバ)
</verb>

<!-- 
<sect1> Firewall with Proxy Server
 -->
<sect1> プロキシサーバを伴うファイアウォール

<P>
<!-- 
If you need to monitor where users of your network are going and your network is small, you can intergrate a proxy server into your firewall.  ISP's some times do this to create interest list of their users to resell to marketing agencies.
 -->
ネットワーク上のユーザのアクセスをモニタする必要があり、ネットワークの
規模が小さいならば、ファイアウォールにプロキシサーバを統合できます。
ISP によっては、これを行ってユーザのリストを作り、マーケティングを
行っている代理店に売っているようなこともあります。
<!--
<verb>
                   __________
    _/\__/\_      | Proxy /  |          _______________
   |        |     | Firewall |  (LAN)  |               |
  / Internet \-&#54;-&#54;|  System  |-&#54;(HUB)-&#54;| Workstation/s |
  \_  _  _  _/    |__________|         |_______________|
    \/ \/ \/  
</verb>
 -->
<verb>
                   __________
    _/\__/\_      |プロキシ/ |           ______________
   |インター|     | ファイア |  (LAN)   |   ワーク     |
  /  ネット  \----| ウォール |--(ハブ)--| ステーション |
  \_  _  _  _/    | システム |          |______________|
    \/ \/ \/      |__________|
</verb>

<!-- 
You can put the proxy server on your LAN as will.  In this case the firewall should have rules to only allow the proxy server to connect to the Internet for the services it is providing.  This way the users can get to the Internet only through the proxy.
 -->
プロキシサーバは、LAN にも好きなように設置できます。
この場合、そのプロキシサーバが提供しているサービスについては、
プロキシサーバだけがインターネットに接続できるようにするべきです。
こうすればユーザはプロキシサーバを通してしかインターネットに
接続できなくなります。

<!--
<verb>
                  __________
   _/\__/\_      |          |          _______________
  |        |     | Firewall |  (LAN)  |               |
 / Internet \-&#54;-&#54;|  System  |-&#54;(HUB)-&#54;| Workstation/s |
 \_  _  _  _/    |__________|    |    |_______________|
   \/ \/ \/                      |     ______________
                                 |    |              |
                                 +-&#54;-&#54;| Proxy Server |
                                      |______________|
</verb>
 -->
<verb>
                  __________
   _/\__/\_      | ファイア |           _______________
  |インター|     | ウォール |  (LAN)   |    ワーク     |
 /  ネット  \----| システム |--(ハブ)--|  ステーション |
 \_  _  _  _/    |__________|    |     |_______________|
   \/ \/ \/                      |     ______________
                                 |    |              |
                                 +----|プロキシサーバ|
                                      |______________|
</verb>

<!-- 
<sect1> Redundent Internet Configuration
 -->
<sect1> 冗長なインターネットの設定

<P>
<!-- 
If you are going to run a service like YAHOO or maybe SlashDot you may want to make your system by using redundant routers and firewalls.  (Check out the High Availability HowTo.) 
 -->
YAHOO や SlashDot のようなサービスを稼働させるつもりなら、冗長なルータと
ファイアウォールを用いてシステムを構築したくなることでしょう。
(High Availability HowTo をご覧になってください。)
【訳注: Linux High Availability HOWTO は
<url url="http://www.ibiblio.org/pub/Linux/ALPHA/linux-ha/High-Availability-HOWTO.html" name="http://www.ibiblio.org/pub/Linux/ALPHA/linux-ha/High-Availability-HOWTO.html">
にあります。
High Availability は「高可用性」を意味します。】

<!-- 
By using a round-robin DNS techniques to provide access to multipule web servers from one URL and multiple ISP's, routers and firewalls using High Avaibility technics you can create a 100% uptime service.
 -->
 1つの URL と複数の ISP から複数の web サーバへのアクセスを提供する、
round-robin DNS の技術を使えば、単一の URL に対するアクセスを
複数の web に捌くことができます。
そして High availability 技術を使っている ISP・ルータ・ファイアウォールを
複数用いることによって、 100% フル稼働のサービスを実現できます。

【訳注: round-robin とは、円形に署名した請願書を意味します。
ここでは DNS にある一つの URL に対して複数のサーバの対応関係を列挙し、
多数のクライアントの要求に対してそのリストを順番に使用することにより、
負荷分散を実現する手法です。
DNS の最後のエントリに到達したら最初に戻って使い回す有り様を
round-robin という言葉で説明しています。】

<!--
<verb>
   _/\__/\_                                     _/\__/\_  
  |        |                                   |        | 
 /  ISP #1  \______                 (WAN)_____/ Partners \
 \_  _  _  _/      |                (HUB)     \_  _  _  _/
   \/ \/ \/        |               ___|____     \/ \/ \/  
                 __|___           |_______ |
   _/\__/\_     |_____ |         |Firewall||          ______
  |        |   |      ||  (DMZ)  | System ||  (LAN)  |      |
 /  ISP #2  \-&#54;|Router||-&#54;(HUB)-&#54;|  (VPN) ||-&#54;(HUB)-&#54;| WS/s |
 \_  _  _  _/  |______|     |    |________|     |    |______|
   \/ \/ \/                 |         |         |     ______
          |             (Outside)  (Shared)     |    |      |
  -&#54;-&#54;-&#54;  |             (Server)   (Server)     +-&#54;-&#54;|Proxy |
 | WS/s | |                                          |______|
 | VPN  |-+
 |______|
</verb>
 -->
<verb>
   _/\__/\_                                       _/\__/\_  
  |        |                                     |        | 
 /  ISP #1  \______                  (WAN)______/パートナー\
 \_  _  _  _/      |                 (ハブ)     \_  _  _  _/
   \/ \/ \/        |                ___|____      \/ \/ \/  
                 __|___            |_______ |
   _/\__/\_     |_____ |          |ファイア||           ______
  |        |   |      ||  (DMZ)   |ウォール||  (LAN)   |      |
 /  ISP #2  \--|ルータ||--(ハブ)--|システム||--(ハブ)--| WS/s |
 \_  _  _  _/  |______|     |     | (VPN)  |     |     |______|
   \/ \/ \/                 |     |________|     |      ________
          |              (外部)        |         |     |        |
  ------  |             (サーバ)     (共有)      +-----|プロキシ|
 | WS/s | |                         (サーバ)           |________|
 | VPN  |-+
 |______|
</verb>

<!-- 
It is easy to let your network get out of hand.  Keep control of every connection. It only takes a user with a modem to compromise your LAN.
 -->
ネットワークはすぐにあなたの手に負えなくなるものです。
全ての接続を把握し続けてください。
ユーザがモデムを持っていて、そのモデムから LAN に侵入されたら、
LAN は危機に陥ります。

<!-- 
It only takes a user with a modem to compromise your LAN.
この文の意味がいまいち不明で、かなりいい加減な訳になってしまってます。
 -->

<!-- (4) -->
<!-- 
<sect>Setting up the Linux Filtering Firewall 
 -->
<sect>Linux フィルタリングファイアウォールを設定する 

<p>
<!-- 
<sect1>Hardware requirements
 -->
<sect1>最低限必要なハードウェアの条件

<p> 
<!-- 
Filtering firewalls don't require fancy hardware. They are little more then simple routers. 
 -->
フィルタリングファイアウォールに高級なハードウェアは不要です。
単純なルータに毛が生えたようなもので用が足ります。

<!-- 
All you need is:
 -->
必要なものは - 

<!-- 
<enum>
<item> a 486-DX66 with 32 meg of memory 
<item> a 250m hard disk (500 recommended)
<item> network connections (LAN Cards, Serial Ports, Wireless?)
<item> monitor and keyboard
</enum>
 -->
<enum>
<item> 486DX2 66MHz と 32 MB メモリ
<item> 250MB のハードディスク (500MB 以上がお薦めです)
<item> ネットワーク接続 (LAN カード、シリアルポート、ワイヤレス?)
<item> モニタとキーボード
</enum>

【訳注: 勿論、今時こんなロースペックなハードウェアを揃えるのは却って困難です。
現時点で入手できるハードウェアのうちで安価なもので十分でしょう。
但し、安定して稼働する実績を持つものが望まれることは言うまでもありません。
また、もしも中古品を購入するつもりなら、ハードディスクのような寿命の
短いものには注意してください。
それと、このリストにはビデオカードが抜けています。
OSのインストールの際には必要と思われるフロッピーディスクドライブや
CD-ROM ドライブも抜けています。ご注意を。】

<!-- 
With some systems by using a serial port console, you can even eliminate the monitor and keyboard.
 -->
システムによってはシリアルポートコンソールを使用することで、モニタと
キーボードを省略することも可能です。

【訳注: シリアルコンソールのサポートはカーネル 2.2 系以降となっています。】

<!-- 
If you need a proxy server that will handle lots of traffic, you should get the largest system you can afford.  This is because for every user that connects to the system it will be creating another process. If you will have 50 or more concurrent users I'm guessing you will need:
 -->
膨大なトラフィックを捌くプロキシサーバを必要とするなら、入手し得る限りで
最強のハードウェアスペックが必要になります。
何故なら、ユーザが接続を行う度毎にプロセスが発生するからです。
50人以上同時に接続するような場合は、以下のようなスペックが必要かと
思います - 
<!--
largest を敢えて「最強」と意訳してみました。
 -->
<!-- 
<enum>
<item> a Pentium II with 64meg of memory
<item> a two gig hard disk to store all the logs
<item> two network connections
<item> monitor and keyboard
</enum>
 -->
<enum>
<item> ペンティアム II と 64MB メモリ
<item> 全てのログを記録する為の 2GB のハードディスク
<item> 2つのネットワークへの接続
<item> モニタとキーボード
</enum>
【訳注: この文書を翻訳している時点では、上記スペックはもう最強では
ないですね。:-)】
<!-- 
The network connections can be any type (NIC cards, ISDN, even modems).  
 -->
ネットワーク接続はあらゆる種類が想定されます
(NIC, ISDN, モデムの場合もあるかもしれません)。
<!--
# NIC の C って Card じゃなかったかなあ。(中野さん)
です。ですので、「カード」を外しました。(松田)
 -->

<!-- 5-11 章-->

<!-- ●(5) -->
<sect>
<!-- 
Software requirements
-->
必要なソフトウェア

<p>
<sect1>
<!-- 
 Selecting a Kernel
 -->
カーネルの選択
<p> 
<!-- 
To create a filtering firewall, you don't need any special software. Linux will do. At the time of this writing I'm using RedHat 6.1.  
-->
フィルタリングファイアウォールを構築する為に特別なソフトウェアは要りません。
Linux が行います。
この文書を書いている時点で、私は RedHat 6.1 を使っています。

<!-- 
    built?
The bilt in Linux firewall have changed several times. If you are using an old Linux kernel (1.0.x or older) geta new copy. These older used ipfwadm from <bf>http://www.xos.nl/linux/ipfwadm/</bf> and is no longer supported.
-->

Linux に組み込みのファイアウォールは何度か変更されてきました。
古いカーネル(1.0.x もしくはそれより古いもの)を使っているなら、新しいものを
入手してください。
これら古いカーネルは <bf><htmlurl url="http://www.xos.nl/linux/ipfwadm/" name="http://www.xos.nl/linux/ipfwadm/"></bf> にあるipfwadm を使っており、
もうサポートされていません。

【訳注: お使いのカーネルのバージョンと Ipfwadm のバージョンに注意してください。
 <htmlurl url="http://www.xos.nl/linux/ipfwadm/versions.html" 
  name="http://www.xos.nl/linux/ipfwadm/versions.html"> を確認してください。】

<!-- 
If you are using 2.2.13 or newer you will be using ipchaining as developed by <bf>http://www.rustcorp.com/linux/ipchains/</bf>
-->
2.2.13 以降を使っているなら、
<bf><htmlurl url="http://netfilter.samba.org/ipchains/"
name="http://netfilter.samba.org/ipchains/"></bf> で開発された
ipchains を使用できます。

<!-- 
If you are using the newer 2.4 kernal there is a new firewall utility with more feachers.  I will write about this soon.
 feature??
 -->
最新の 2.4 カーネルを使っているなら、より新しい仕様のファイアウォール
ユーティリティがあります。
近いうちにそれについて書きます。

<sect1>
<!-- 
 Selecting a proxy server
 -->
プロキシサーバを選択する

<P>
<!-- 
If you want to setup a proxy server you will need one of these packages.
-->
プロキシサーバの設定をしたいなら、次のパッケージのどれか一つが必要です。

<enum>
<item> Squid
<item> The TIS Firewall Toolkit (FWTK)
<item> SOCKS
</enum>
【訳注:  プロキシサーバプログラム DeleGate もあります。
        DeleGate については次のところを参考にしてください。
        <htmlurl url="http://www.delegate.org/delegate/" 
          name="http://www.delegate.org/delegate/">】

<p>
<!-- 
Squid is a great package and works with Linux's Transparent Proxy feature. I will be describing how to setup this server. 
-->
Squid はとても素晴らしいパッケージで Linux の透過プロキシ (Transparent
Proxy) 機能と共に動作します。
このサーバを設定する方法について書こうと思います。

<!-- 
AT the time of this writing, <url url="http://www.networkassociates.com/" name="Network Associates"> and Trusted Information System's (TIS) , have merged. So keep watching their web sites for more information about changes. Mean while, the Tool Kit can still be had at. <bf><url url="http://www.tis.com/research/software/" name="http://www.tis.com/research/software/"></bf>
-->
この文書を書いている時点で、
<url url="http://www.networkassociates.com/" name="Network Associates"> と
Trusted Information System's (TIS) は合併しています。
変更についての詳細情報に関する web サイトに注意しておきましょう。
一方、ツール類はまだ次のところにあります。
<bf><url url="http://www.tis.com/research/software/" name="http://www.tis.com/research/software/"></bf>

<!-- 
Trusted Information System put out a collection of programs designed to facilitate firewalling.  With this toolkit, you set up one daemon for each service (WWW, telnet ect.) you will be using.
-->
Trusted Information System は ファイアウォールの設定を簡単にするように
設計されたプログラム群を提供しています。
これらのツール類を使うことで、それぞれのサービス (WWW や telnet など) を
一つのデーモンに設定できます。

【訳注: Trusted Information System については次のところを参考にしてください。
<htmlurl url="http://www.uth.tmc.edu/oac_docs/trust/trusted.htm" name="http://www.uth.tmc.edu/oac_docs/trust/trusted.htm">】

<!-- ●(6) -->

<sect>
<!-- 
Preparing the Linux system
-->
Linux システムを準備する

<p>
<!-- 
Install as little of the Linux system as you can. My  installation started with a server configuration and then I turn off ever un-needed service in /etc/inetd.conf.  For more security you should uninstall the unneeded service. 
-->
できるだけ小さい規模で、Linux システムをインストールします。
私がインストールをするときは、まずサーバの設定を行い、次いで
/etc/inetd.conf で不必要なサービスを外します。
更にセキュリティを高めたいなら、不必要なサービスは
アンインストールしてしまいましょう。

<!-- 
Because most distributions don't dome with a kernel usefull to your
perpose.  You will need to compile your own kernal. It is best if you do
 purpose??
this on a computer other then the firewall. If you do install a C
compiler and utilities on your firewall, remove them after you have
completed comfiguring your kernel.  
         configuring
-->
殆どのディストリビューションは自分の目的に応じたカーネルに
なっていませんから、自分の目的にあったカーネルに
コンパイルしなければいけません。
ファイアウォール以外のコンピュータでコンパイルができるなら、
それが一番良い方法です。
C コンパイラなどのユーティリティをファイアウォールに
インストールしてしまった場合は、カーネルの設定が完了した後で
削除しましょう。

<sect1>
<!-- 
Compiling the Kernel
-->
カーネルのコンパイル

<p> 
<!-- 
Start with a clean minimal installation of your Linux distribution. The less software you have loaded the less holes, backdoors and/or bugs there will be to introduce security problems in your server.
-->

お使いになる予定の Linux ディストリビューションの最小限度のインストールから
始めてください。
ソフトウェアを減らせば、お使いのサーバでのセキュリティ問題の原因になる
セキュリティホールやバックドア (不正な手段での侵入) 、或はバグなどが
より少なくなります。

<!-- 
Pick a stable kernel. I am using kernel 2.2.13 kernel for my system. So this documentation is based on it's settings.
 -->
安定版のカーネルを入手してください。
私のシステムではカーネル 2.2.13 を使っています。
この文書はその環境での設定を基本にしました。

<!-- 
You well need to recompile the Linux kernel with the appropriate options. If you haven't recompiled your kernel before you should read the Kernel HOWTO, the Ethernet HOWTO, and the NET-2 HOWTO.
-->
適切なオプションで Linux のカーネルをコンパイルしなければいけません。
カーネルの再構築をした経験がないなら、実行する前に Kernel HOWTO,
Ethernet HOWTO, NET-2 HOWTO を読みましょう。

<!-- 
Here are the network related setting I know work.  I have marked some with a ?. If you will be using this feature, turn it on as well.
-->
次にネットワーク関連の設定を示します。これが動作することは確認してあります。
いくつかの項目には ? という印をつけています。
このような設定を使うつもりなら、チェックをいれて選択してください。

<!-- 
I use "make menuconfig" to edit my kernel settings.
-->
カーネルの設定の為に、私は "make menuconfig" を使っています。

【訳注: 個々の項目については、Configure.help の日本語版も参考にしてください。
<htmlurl url="http://www.linux.or.jp/JF/JFdocs/Configure.help/" name="http://www.linux.or.jp/JF/JFdocs/Configure.help/">】

<verb>
    <*> Packet socket
    [ ] Kernel/User netlink socket
    [*] Network firewalls
    [ ] Socket Filtering
    <*> Unix domain sockets
    [*] TCP/IP networking
    [ ] IP: multicasting
    [*] IP: advanced router
    [ ] IP: kernel level autoconfiguration
    [*] IP: firewalling
    [?] IP: always defragment (required for masquerading)
    [?] IP: transparent proxy support
    [?] IP: masquerading
    --- Protocol-specific masquerading support will be built as modules.
    [?] IP: ICMP masquerading
    --- Protocol-specific masquerading support will be built as modules.
    [ ] IP: masquerading special modules support
    [*] IP: optimize as router not host
    < > IP: tunneling
    < > IP: GRE tunnels over IP
    [?] IP: aliasing support
    [*] IP: TCP syncookie support (not enabled per default)
    --- (it is safe to leave these untouched)
    < > IP: Reverse ARP
    [*] IP: Allow large windows (not recommended if <16Mb of memory)
    < > The IPv6 protocol (EXPERIMENTAL)
    ---
    < > The IPX protocol
    < > Appletalk DDP
    < > CCITT X.25 Packet Layer (EXPERIMENTAL)
    < > LAPB Data Link Driver (EXPERIMENTAL)
    [ ] Bridging (EXPERIMENTAL)
    [ ] 802.2 LLC (EXPERIMENTAL)
    < > Acorn Econet/AUN protocols (EXPERIMENTAL)
    < > WAN router
    [ ] Fast switching (read help!)
    [ ] Forwarding between high speed interfaces
    [ ] PU is too slow to handle full bandwidth
    QoS and/or fair queueing  ---> 
</verb>

<!-- 
After making all the setting you need you should recompile, reinstall the kernel and reboot.
 -->
全ての設定をしてから、再コンパイルし、カーネルを再インストールし、
再起動します。

<!-- 
I use the command:
-->
次のようなコマンドで行います - 

<!-- 
make dep;make clean;make bzlilo;make modules;make modules_install;init 6 to accomplish all of this in one step.
-->
 1行のコマンドで全部を行うには、次のようにします。
make dep;make clean;make bzlilo;make modules;make modules_install;init 6

<sect1>
<!-- 
Configuring two network cards
-->
二枚のネットワークカードを設定する

<p> 
<!-- 
If you have two network cards in your computer, you may need to add an append statement to your /etc/lilo.conf file to describe the IRQ and address of both cards.  My lilo append statement looks like this:
 -->
コンピュータに二枚のネットワークカードを挿しているなら、IRQ と二枚の
カードのアドレスを /etc/lilo.conf ファイルに append を使って明示的に
加えなければならない場合があります。
私の lilo の append 行は次のようになっています - 

<verb> 
append=&dquot;ether=12,0x300,eth0 ether=15,0x340,eth1&dquot; 
</verb>

【訳注: ネットワークカードの設定は、次のような文書も参考にしてください。
<htmlurl url="http://www.linux.or.jp/JF/JFdocs/Ethernet-HOWTO.html" name="http://www.linux.or.jp/JF/JFdocs/Ethernet-HOWTO.html">
<p>
<htmlurl url="http://www.linux.or.jp/JF/JFdocs/Multiple-Ethernet.html" name="http://www.linux.or.jp/JF/JFdocs/Multiple-Ethernet.html">】


<sect1>
<!-- 
Configuring the Network Addresses
-->
ネットワークアドレスの設定

<p> 
<!-- 
Now we arrive at the fun part of our setup. I'm not going to go deep into how to setup a LAN.  Read the Networking-HOWTO to solve your problems here.
-->
さて、構築作業も面白いところにきています。
この文書では LAN を設定する方法について深くは説明しません。
この件についてのあなたの問題を解決するには、 Networking-HOWTO を
読んでください。

【訳注: Networking-HOWTO の日本語訳は、次のところにあります。
<htmlurl url="http://www.linux.or.jp/JF/JFdocs/NET3-4-HOWTO.html" name="http://www.linux.or.jp/JF/JFdocs/NET3-4-HOWTO.html">】

<!-- 
Your goal is to provide two network connection to your filtering firewall system. One on the Internet (unsecured side) and one on the LAN (secure side).
-->
あなたの目的は、フィルタリングファイアウォールを通して、二つの
ネットワーク接続を提供することです。
インターネット上に一つ(安全でない側)と LAN (閉じた側) に一つということに
なります。

<!-- 
# 原文も "through your filtering firewall" の方が
# いいんじゃないかなあ。
-->

<!-- 
Anyway, you have a few decisions to make.
 -->
とにかく、いくつかのことを決定しなければなりません。

<!-- 
<enum>
<item> Will you use Real IP number or Make some up for your LAN.
<item> Will your ISP assign the number or will you be using static IP numbers?
</enum>
-->

<enum>
<item> 本物の IP 番号を使いますか、それとも LAN には適当な番号を指定しますか。
<item> あなたの ISP から割り当てられる番号を使いますか、 
       それとも、静的な IP 番号を使いますか。
</enum>

<!-- 
Since you don't want the internet to have access to your private network, you don't need to use &dquot;real addresses&dquot;.  You could just makeup addresses for your private LAN. But this is not recommended. If data gets routed out of your LAN, it might end up at another systems port. 
-->
プライベートなネットワークにインターネットからのアクセスを
許可したくないわけですから、 &dquot;本物のアドレス&dquot; を使う必要は
ありません。
プライベート LAN に対して適当なアドレスを振ることはできますが、
これはお勧めできません。
データが LAN からある経路を通って漏れてしまったら、どこかのシステムの
ポートまで届いてしまいます。

<!-- 
There are a number of Internet address ranges set aside for private networks. Of these, 192.168.1.xxx, is set aside and we will use it in our examples.
 -->
プライベートネットワーク用に取りわけられている幾つかの
インターネットアドレスの範囲があります。
192.168.1.xxx もこの中に入っていて、この文書ではこれを例に使います。

<!-- 
You will need to use IP masquerading to make this happen. With this process the firewall will forward packets and translate them into  &dquot;REAL &dquot; &dquot; IP address to travel on the Internet.
-->
この数値を使う為には IP マスカレードを使う必要があります。
この方法で ファイアウォールはパケットをフォワードして、
インターネット上で &dquot;本物の&dquot; アドレスに変換します。

<!--
Using these non-routable IP address makes your network is more secure.  Internet routers will not pass packets with these addresses.
 -->
このようなルーティングできない IP アドレスを使えば、あなたのネットワークは
より安全になります。
インターネットルータは、このようなプライベートアドレスのついたパケットを
通しません。

<!-- 
You may want to read the <url url="http://members.home.net/ipmasq/" name="IP Masquerading HOWTO"> at this point.
-->
この件に関しては、次の文書を読んだほうがよいでしょう。
 <url url="http://members.home.net/ipmasq/" name="IP Masquerading HOWTO">

【訳注: IP Masquerade HOWTO の日本語訳は、次のところにあります。
<url url="http://www.linux.or.jp/JF/JFdocs/IP-Masquerade.html">】

<!-- 
<verb>
            24.94.1.123  __________    192.168.1.1
      _/\__/\_        \ |          | /           _______________
     |        |        \| Firewall |/           |               |
    / Internet \-&#045;-&#045;-&#045;-&#045;|  System  |-&#045;-&#045;-&#045;-&#045;-&#045;-&#045;| Workstation/s |
    \_  _  _  _/        |__________|            |_______________|
      \/ \/ \/  
</verb>
 -->
<verb>
            24.94.1.123  __________    192.168.1.1
      _/\__/\_        \ | ファイア | /           _______________
     |インター|        \| ウォール |/           |     ワーク    |
    /  ネット  \--------| システム |------------|  ステーション |
    \_  _  _  _/        |__________|            |_______________|
      \/ \/ \/ 
</verb>

<!-- 
You must have a &dquot;real&dquot; IP address to assign to your Internet network card. This address can be permanently assigned to you. (A static IP address) or it can be assigned at network connect time by the PPP process.
-->
お使いのインターネット用ネットワークカードに割り当てるための
&dquot;本物の&dquot; IP アドレスを持っていなければいけません。
このアドレスは、あなたに永続的に割り当てられたもの (静的な IP アドレス)
でもいいですし、 PPP プロセスによるネットワークへの接続時に
割り当てられたものでもかまいません。

<!-- 
You assign your inside IP numbers. Like 192.168.1.1 to the LAN card. This will be your gateway IP address.  You can assign all the other machines in the protected network (LAN) a number in the 192.168.1.xxx range. (192.168.1.2 through 192.168.1.254)
 -->
内側の IP 番号を割り当てます。
たとえば LAN カードに対して 192.168.1.1 のようにします。
これはゲートウェイアドレスになります。
保護されたネットワーク (LAN) にいる他の全てのマシンには、
192.168.1.xxx の範囲 (192.168.1.2 から 192.168.1.254 まで) の番号を
割り当てることができます。

<!-- 
I use RedHat Linux. To configure the network at boot time I added a ifcfg-eth1 file in the  /etc/sysconfig/network-scripts directory.  You may also find a ifcfg-ppp0 or ifcfg-tr0 in this directory. These 'ifcfg-' files are used by RedHat to configure and enable your network devices at boot 
time. The are named after the connection type.
-->
私は RedHat Linux を使用しています。
起動時にネットワークを設定するため、私は /etc/sysconfig/network-scripts
というディレクトリにある ifcfg-eth1 ファイルに記述を追加しています。
このディレクトリに ifcfg-ppp0 や ifcfg-tr0 というファイルもあるはずです。'ifcfg-'
というファイルは、 RedHat で、起動時にネットワークデバイスを
設定し、使用可能にする為に使われています。
接続のタイプによって名前がつけられています。

<!-- 
Here is the ifcfg-eth1 (second ehternet card) for our example;
-->
これが ifcfg-eth1(二つ目のイーサネットカード)の例です - 

<verb>
    DEVICE=eth1
    IPADDR=192.168.1.1
    NETMASK=255.255.255.0
    NETWORK=192.168.1.0
    BROADCAST=192.168.1.255
    GATEWAY=24.94.1.123
    ONBOOT=yes
</verb>

<!-- 
If you are going to use a dialup connection you will need to look at the ifcfg-ppp0 and the chat-ppp0 file. These control your PPP connection.
-->
ダイアルアップ接続をするつもりなら、ifcfg-ppp0 と chat-ppp0 を見なければ
なりません。
これらは PPP 接続を制御します。

<!-- 
This ifcfg file might look like;
-->
この場合の ifcfg ファイルは次のようになります - 

<verb>
    DEVICE=&dquot;ppp0&dquot;           
    ONBOOT=&dquot;yes&dquot;
    USERCTL=&dquot;no&dquot;
    MODEMPORT=&dquot;/dev/modem&dquot;      
    LINESPEED=&dquot;115200&dquot;          
    PERSIST=&dquot;yes&dquot;   
    DEFABORT=&dquot;yes&dquot;  
    DEBUG=&dquot;yes&dquot;     
    INITSTRING=&dquot;ATZ&dquot;
    DEFROUTE=&dquot;yes&dquot;  
    HARDFLOWCTL=&dquot;yes&dquot;           
    ESCAPECHARS=&dquot;no&dquot;
    PPPOPTIONS=&dquot;&dquot;   
    PAPNAME=&dquot;LoginID&dquot;           
    REMIP=&dquot;&dquot;        
    NETMASK=&dquot;&dquot;      
    IPADDR=&dquot;&dquot;       
    MRU=&dquot;&dquot;          
    MTU=&dquot;&dquot;          
    DISCONNECTTIMEOUT=&dquot;&dquot;        
    RETRYTIMEOUT=&dquot;5&dquot;
    BOOTPROTO=&dquot;none&dquot;
</verb>


<sect1>
<!-- 
Testing your network
-->
ネットワークを試してみる

<p> 
<!-- 
Start by using the ifconfig and route commands.  If you have two network cards ifconfig should look something like:
-->
ifconfig と route コマンドを使ってみましょう。
二枚のネットワークカードを使っているなら、次のように表示されます。

<verb>
  #ifconfig
  lo        Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            UP LOOPBACK RUNNING  MTU:3924  Metric:1
            RX packets:1620 errors:0 dropped:0 overruns:0
            TX packets:1620 errors:0 dropped:0 overruns:0
	    collisions:0 txqueuelan:0

  eth0      Link encap:10Mbps Ethernet  HWaddr 00:00:09:85:AC:55
            inet addr:24.94.1.123 Bcast:24.94.1.255  Mask:255.255.255.0
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:1000 errors:0 dropped:0 overruns:0
            TX packets:1100 errors:0 dropped:0 overruns:0
	    collisions:0 txqueuelan:0
            Interrupt:12 Base address:0x310

  eth1      Link encap:10Mbps Ethernet  HWaddr 00:00:09:80:1E:D7
            inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
            UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
            RX packets:1110 errors:0 dropped:0 overruns:0
            TX packets:1111 errors:0 dropped:0 overruns:0
	    collisions:0 txqueuelan:0
            Interrupt:15 Base address:0x350
</verb>

<!-- 
and your route table should look like:
-->
更に経路テーブルは次のようになります - 

<verb>
  #route -n
  Kernel routing table
  Destination     Gateway         Genmask         Flags MSS    Window Use Iface
  24.94.1.0       *               255.255.255.0   U     1500   0       15 eth0
  192.168.1.0     *               255.255.255.0   U     1500   0        0 eth1
  127.0.0.0       *               255.0.0.0       U     3584   0        2 lo
  default         24.94.1.123     *               UG    1500   0       72 eth0
</verb>

<!-- 
<bf>Note:</bf> 24.94.1.0 is the Internet side of this firewall and 192.168.1.0 is the private (LAN) side.
-->
<bf>注意 - </bf> 24.94.1.0 は、このファイアウォールのインターネット側で、
192.168.1.0 はプライベート( LAN )側になります。

<!-- 
You should start by making sure every computer on your LAN can ping the inside address of your firewall system. (192.168.1.1 in this example) If not, go over the NET-2 HOWTO again and work on the network some more.
-->
LAN 上にある全てのコンピュータが、ファイアウォールシステムの内側の
アドレスに ping できるかどうかを調べましょう
(ここでは 192.168.1.1 を例にしています)。
うまくできないなら、再度 NET-2 HOWTO を見てください。
そして、もう少しネットワークについて調べてください。

<!-- 
Next, from the firewall, try to ping a Internet system.  I use www.internic.net as my test point.  If it doesn't work, try a server at your ISP. If this doesn't work some part of your Internet connection is wrong.  You should be able to connect to the anywhere on the Internet from the firewall. Try looking at your default gateway setting.  If you are using a dialup connection double check your user ID and Password. Reread 
the Net-2 HOWTO, and try again.
-->
次に、ファイアウォールからインターネットシステムに ping を試してみます。
私はテストポイントとしてwww.internic.net を使っています。
もしこれがうまく動かなければ、お使いの ISP でのサーバを試してみます。
これがうまく動かなければ、あなたのインターネット接続のどこかがきちんと
設定されていません。
ファイアウォールからは、インターネットのあらゆる場所に接続できなければ
なりません。
デフォルトのゲートウェイの設定を見直してください。
ダイアルアップ接続を使っているなら、ユーザ ID とパスワードを
見直してください。
Net-2 HOWTO をもう一度読んでから再度試してください。

<!-- 
<code>
Now try to ping the outside address of the firewall (24.94.1.123) from a computer on your LAN. This shouldn't work.  If it does, you have masquerading or IP Forwarding turned on, or you already have some packet filtering set. Turn them off and try again. You need to know the filtering is in place.</code>
-->
<code>
あなたの LAN 上にあるコンピュータから、ファイアウォール(24.94.1.123) の
外側のアドレスに ping を試してみます。
これは動かないはずです。
もし ping できるなら、あなたはマスカレードを行っているか、
IP フォワーディングを使っているか、あなたは既に何らかの
パケットフィルタリングを設定しているのです。
それらを無効にして再度試してください。
フィルタリングが正しい状態にあることを確認しなければなりません。
</code>

<!-- 
For kernels newer then 2.1.102 you can issue the command;
-->
2.1.102 より新しいカーネルに対しては、以下のコマンドが使えます - 

<verb>
    echo "0" > /proc/sys/net/ipv4/ip_forward
</verb>

<!-- 
If you are using an older kernel (WHY) you will need to re-compile your kernel with forwarding turned off. (Just upgrade.)
 -->
(何故かは分かりませんが) 古いカーネルを使っているなら、フォワードを
無効にしてカーネルを再コンパイルしなければいけないでしょう
(カーネルのアップグレードをするのにちょうどいい機会です)。

<!-- 
Try pinging the outside address of the firewall (24.94.1.123) again. It shouldn't work.
-->
再度ファイアウォール (24.94.1.123) のアドレスの外側に向けて ping を
試します。
動いてはいけないのです。

<!-- 
Now turn on IP forwarding and/or masquerading. You should be able to ping the anywhere on the Internet from any system on your LAN.
-->
ここまでを確認したところで、IP フォワーディング及び/又は IP マスカレードを
有効にします。
あなたの LAN 上のどんなシステムからインターネット上のどのような場所にも
ping が可能になるはずです。

<verb>
    echo "1" > /proc/sys/net/ipv4/ip_forward
</verb>

<!-- 
<BF>BIG NOTE:</BF> 
If you are using &dquot;REAL&dquot; IP addresses on your LAN (not 192.168.1.*) and you can't ping the internet but you CAN ping the Internet side of your firewall, make sure your ISP is routing packets for 
your private network address.
 -->
<BF>重要な注意 - </BF>
もし、あなたが LAN 上で、 (192.168.1.* ではない) &dquot;本物の&dquot;
IP アドレスを使っていて、
インターネットへ ping できないが、あなたのファイアウォールの
インターネット側には ping できる場合は、接続先の ISP が
あなたのプライベートネットワークのアドレスからのパケットを
ルーティングしているかどうか確認してください。

【訳注: ここではユーザのマシン全てにグローバル IP を割り当てている
場合を説明しています。】

<!-- 
A test for this problem is to have someone else on the Internet (say a friend using a local provider) use traceroute to your network. If the trace stops at your providers router, then they are not forwarding your 
traffic.
-->
この問題をテストするには、インターネット上の誰か
(例えばローカルのプロバイダを使っている友人に頼んで) に、あなたの
ネットワークに traceroute してもらうことです。
traceroute による経路探索が、あなたが使っているプロバイダのルータで
停止するなら、プロバイダはあなたのトラフィックを転送していないのです。

<!-- 
It works? Great. The hard part is done. :-)
 -->
動きましたか? 素晴らしい。難しい場所は終わりました。:-)

<sect1>
<!-- 
Securing the Firewall
-->
ファイアウォールを安全にする

<p>
<!-- 
A firewall isn't any good if the system it is build on is left wide open to attacks.  A &dquot;bad guy&dquot; could gain access to the through a non firewall service and modify it for their own needs. You need to turning off any unneeded services.
 -->
ファイアウォールは、それが動作しているシステムそのものが、攻撃に対して
広く開けっ放しになったままだと、なんら意味をなしません。
&dquot;悪い奴ら&dquot; は ファイアウォール以外のサービスを通して
アクセスしてしまいますし、好き勝手に変更してしまいます。
不要なサービスはどれも無効にしなければなりません。

<!-- 
Look in your /etc/inetd.conf file.  This file configures inetd also known as the &dquot;super server&dquot;.  It controls a bunch of the server daemons and starts them as they are requested by a packet arriving at a 
&dquot;well known&dquot; port.
-->
/etc/inetd.conf ファイルを見てください。
これは &dquot;super server&dquot; として知られる inetd を設定する
ファイルです。
inetd は沢山のサーバデーモンを制御し、&dquot;well known&dquot; ポート
への要求パケットが到着すると、それらをスタートさせます。

【訳注: well known port は、 TCP/UDP ポート番号 1024 番以下のポートを
指します。】

<!-- 
You should turn off echo, discard, daytime, chargen, ftp, gopher, shell, login, exec, talk, ntalk, pop-2, pop-3, netstat, systat, tftp, bootp,  finger, cfinger, time, swat and linuxconfig if you have one.  
-->
echo, discard, daytime, chargen, ftp, gopher, shell, login, exec, talk,
ntalk, pop-2, pop-3, netstat, systat, tftp, bootp, finger, cfinger,
time, swat そして linuxconfig 等は全て無効にしましょう。

<!-- 
To turn a service off, put &num; as the first character of the service line.  When your done, send a SIG-HUP to the process by typing <bf>&dquot;kill -HUP &lt;pid&gt;&dquot;</bf>, where &lt;pid&gt; is the 
process number of inetd.  This will make inetd re-read its configuration file (inetd.conf) and restart without taking your system down.
-->
サービスを変更するには、サービス行の最初の文字に &num; を置きます。
これが済んだら <bf>&dquot;kill -HUP &lt;pid&gt;&dquot;</bf> を送ります。
&lt;pid&gt; には、inetd のプロセス番号を書きます。
こうするとその設定ファイルを再読させ、システムを停止させないで
再スタートします。

【訳注: killall というコマンドがあります。 man killall も調べてください。
      killall -HUP inetd が使えます。】

<!-- 
Test this by telneting to port 15 (netstat) on firewall.  If you get any output you have not turned these services off.
-->
ファイアウォールの port 15 (netstat) に対して telnet してみてください。
何か出力するようなら、サービスは無効になっていません。

telnet localhost 19

<!-- 
You can also create the file /etc/nologin. Put a few line of text in it like (BUZZ OFF). When this file exists, login will not allow user to logon. They will see the contents of this file and their logins refused. Only root 
can logon.
-->
/etc/nologin というファイルを作成することもできます。
BUZZ OFF (繋がないの意味) のように、このファイルにちょっとしたテキストを
書きます。
このファイルが存在すると、 login はユーザのログオンを許可しません。
ユーザはこのファイルの内容を見ることになり、ログインは拒否されます。
root だけがログインできます。

<!-- 
You can also edit the file /etc/securetty. If  the  user  is  root,  then  the  login  must  be  occurring  on  a  tty  listed  in /etc/securetty.  Failures will be logged with the syslog facility. With both of these controls in place the only way to logon to the firewall will be as root from the console.
-->
/etc/securetty というファイルも編集できます。
ユーザが root なら、 /etc/securetty に列挙された tty からしか
ログインできません。
失敗すると、 syslog 機能で記録されます。
これらの両方のコントロールを有効にすれば、ファイアウォールへのログオンは、
root としてコンソール経由でしか行えなくなります。

<!-- 
NEVER EVER TELNET to a system and log IN AS ROOT.  If you need remote root access SSH (Secure Shell).  You might even turn off telnet.  
-->
絶対に telnet で root としてログインしてはいけません。
リモート root を必要とするなら、SSH (Secure Shell) でアクセスします。
telnet は無効にすべきでしょう。

<!-- 
If you are really paranoid you need to be using lids (Linux Intrusion Detect System). It is an intrusion detection system patch for the Linux kernel; it can protect important files from being changed. When it's in effect, no one (including root) can change the protected files or directories and their sub-directories. You have to reboot the system with a security=1 LILO setting to modify secure files. (I'd also boot into single user mode.)
 -->
心配性な人は、lids (Linux Intrusion Detect System 割り込み検知システム) 
を使う必要があるかもしれません。
これは Linux カーネルに対する侵入禁止システムのパッチです。
重要なファイルを改竄から守ります。
この仕組みを使うと、 防御対象のファイルやディレクトリ、更にその配下の
サブディレクトリは (root を含めて) 誰も変更できなくなります。
このような安全化されたファイルを変更するには、 LILO の設定で security=1
を指定してシステムをリブートさせなければなりません
(私ならシングルユーザモードで起動させるでしょう)。

<!-- ●(7) -->

<sect>
<!-- 
IP filtering setup (IPFWADM)
 -->
IP フィルタリングの設定(IPFWADM)

<p> 
<!-- 
If you are using kernel 2.1.102 or newer skip to the next section on IPCHAINS.
 -->
カーネル 2.1.102 以上を使っているならこの章を飛ばして、次の IPCHAINS の
章に進んでください。

<!-- 
In older kernels IP Forwarding is turned on by default in the kernel. Because of this, your network should start by denying access to everything and flushing any ipfw rules in place from the last time it was run. This script fragment should go in your network startup script. (/etc/rc.d/init.d/network)
-->
以前のカーネルでは IP Forwarding はデフォルトでカーネルに組み込まれ
有効になっています。
従って、ネットワークを設定する場合は、まず全てを拒否し、
以前に置かれていた ipfw のルールを破棄するべきです。
以下のようなスクリプト (の一部分) を、ネットワークの起動スクリプト
(/etc/rc.d/init.d/network) に書いておかなければいけません。

<!-- 
<verb>
  #
  # setup IP packet Accounting and Forwarding
  #
  #   Forwarding
  #
  # By default DENY all services
  ipfwadm -F -p deny
  # Flush all commands
  ipfwadm -F -f
  ipfwadm -I -f
  ipfwadm -O -f
</verb>
-->

<verb>
  #
  # IP packet Accounting と Forwarding の設定
  #
  #   Forwarding
  #
  # デフォルトで全てのサービスを不許可にする。
  ipfwadm -F -p deny
  # 全てのコマンドを破棄する。
  ipfwadm -F -f
  ipfwadm -I -f
  ipfwadm -O -f
</verb>

<!-- 
Now we have the ultimate firewall. Nothing can get through.
-->
さて、我々は究極のファイアウォールを構築しました。
もう何も通しません。

<!-- 
Now create the file /etc/rc.d/rc.firewall. This script should allow email, Web and DNS traffic through. ;-)
 -->
ここで /etc/rc.d/rc.firewall というファイルを作成します。
このスクリプトは email, web, DNS トラフィックを許可します。 ;-)

<!--
顔マーク位は残しておきましょう。^^;(松田)
 -->

<!-- 
<verb>
#! /bin/sh
#
# rc.firewall
#
# Source function library.
. /etc/rc.d/init.d/functions

# Get config.
. /etc/sysconfig/network

# Check that networking is up.
if [ ${NETWORKING} = "no" ]
then
        exit 0
fi
case "$1" in
  start)
  echo -n "Starting Firewall Services: "
  # Allow email to got to the server
  /sbin/ipfwadm -F -a accept -b -P tcp -S 0.0.0.0/0 1024:65535 -D 192.1.2.10 25
  # Allow email connections to outside email servers
  /sbin/ipfwadm -F -a accept -b -P tcp -S 192.1.2.10 25 -D 0.0.0.0/0 1024:65535
  # Allow Web connections to your Web Server
  /sbin/ipfwadm -F -a accept -b -P tcp -S 0.0.0.0/0 1024:65535 -D 192.1.2.11 80
  # Allow Web connections to outside Web Server
  /sbin/ipfwadm -F -a accept -b -P tcp -S 192.1.2.* 80 -D 0.0.0.0/0 1024:65535 
  # Allow DNS traffic
  /sbin/ipfwadm -F -a accept -b -P udp -S 0.0.0.0/0 53 -D 192.1.2.0/24
  ;;
  stop)
  echo -n "Stooping Firewall Services: "
  ipfwadm -F -p deny
  ;;
  status)
  echo -n "Now do you show firewall stats?"
  ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: firewall {start|stop|status|restart|reload}"
        exit 1
esac
</verb>
-->

<verb>
#! /bin/sh
#
# rc.firewall
#
# 関数ライブラリを読み込む
. /etc/rc.d/init.d/functions

# 設定を取得
. /etc/sysconfig/network

# ネットワークが起動しているかチェックする
if [ ${NETWORKING} = "no" ]
then
        exit 0
fi
case "$1" in
  start)
  echo -n "Starting Firewall Services: "
  # サーバに入る email を許可する。
  /sbin/ipfwadm -F -a accept -b -P tcp -S 0.0.0.0/0 1024:65535 -D 192.1.2.10 25
  # 外部の email サーバへの接続を許可する
  /sbin/ipfwadm -F -a accept -b -P tcp -S 192.1.2.10 25 -D 0.0.0.0/0 1024:65535
  # あなたの Web サーバに Web 接続を許可する。
  /sbin/ipfwadm -F -a accept -b -P tcp -S 0.0.0.0/0 1024:65535 -D 192.1.2.11 80
  # 外部の Web サーバへの Web 接続を許可する。
  /sbin/ipfwadm -F -a accept -b -P tcp -S 192.1.2.* 80 -D 0.0.0.0/0 1024:65535 
  # DNS トラフィックを許可する。
  /sbin/ipfwadm -F -a accept -b -P udp -S 0.0.0.0/0 53 -D 192.1.2.0/24
  ;;
  stop)
  echo -n "Stooping Firewall Services: "
  ipfwadm -F -p deny
  ;;
  status)
  echo -n "Now do you show firewall stats?"
  ;;
  restart|reload)
        $0 stop
        $0 start
        ;;
  *)
        echo "Usage: firewall {start|stop|status|restart|reload}"
        exit 1
esac
</verb>


<!-- 
NOTE: In this example we have the email (smtp) server running at 192.1.2.10 that must be able to send and receive on port 25. The web server running at 192.1.2.11. We are allowing anyone on the LAN to get to outside web and DNS servers.
-->
注意 - この例では、192.1.2.10 に email (smtp) サーバがあって、ポート 25 で
送受信ができなければならないとしています。
web サーバは 192.1.2.11 で運用しています。
LAN にいる全ての利用者が、外部の web サーバと DNS サーバに
到達できるようにしています。

<!-- 
This is not perfectly secure. Because port 80 doesn't have to used as a web port, a smart hacker might use this port to create a virtual private network (VPN) through the firewall.  The way around this is to setup a web proxy. and only allow the proxy through the firewall. Users on the LAN will have to go through the proxy to get to outside web servers.
-->
これは完全に完璧とは言えません。
なぜなら port 80 は、web ポートとして使わなければならないわけではなく、
賢いハッカーならこのポートを使って、ファイアウォールを越える
仮想プライベートネットワーク (VPN) を作るでしょう。
これを避けるには、 web プロキシを設定し、プロキシだけが
ファイアウォールを通過できるようにすることです。
LAN 側のユーザが外のweb サーバに到達する為にはプロキシを
経由しなければならないようにします。

<!-- 
You might also be interested in accounting for traffic going through your firewall. This script will count ever packet.  You could add a line or two to account for packets going to just a single system.
-->
ファイアウォールを通るトラフィックの勘定にも興味があるでしょう。
次のスクリプトは全てのパケットを数えます。
あなたはシングルシステムに向かうパケットを数える為に
一、二行加えることができます。

<!-- 
<verb>          
  # Flush the current accounting rules
  ipfwadm -A -f
  # Accounting
  /sbin/ipfwadm -A -f
  /sbin/ipfwadm -A out -i -S 192.1.2.0/24 -D 0.0.0.0/0
  /sbin/ipfwadm -A out -i -S 0.0.0.0/0 -D 192.1.2.0/24
  /sbin/ipfwadm -A in -i -S 192.1.2.0/24 -D 0.0.0.0/0
  /sbin/ipfwadm -A in -i -S 0.0.0.0/0 -D 192.1.2.0/24
</verb>
 -->

<verb>          
  # 現在のアカウントルールを破棄する。
  ipfwadm -A -f
  # Accounting
  /sbin/ipfwadm -A -f
  /sbin/ipfwadm -A out -i -S 192.1.2.0/24 -D 0.0.0.0/0
  /sbin/ipfwadm -A out -i -S 0.0.0.0/0 -D 192.1.2.0/24
  /sbin/ipfwadm -A in -i -S 192.1.2.0/24 -D 0.0.0.0/0
  /sbin/ipfwadm -A in -i -S 0.0.0.0/0 -D 192.1.2.0/24
</verb>

<!-- 
If all you need is a filtering firewall you can stop here.  Test it and Enjoy.
 -->
必要なのがフィルタリングファイアウォールだけなら、あなたはここで設定を
終えることができます。
テストしてから運用してください。

<!-- ●(8) -->
<sect>
<!-- 
IP filtering setup (IPCHAINS)
 -->
IP フィルタリングの設定(IPCHAINS)

<p>
<!-- 
Linux ipchains is a rewrite of the Linux IPv4 firewalling code and a rewrite of ipfwadm, which was a rewrite of BSD's ipfw, I believe. It is required to administer the IP packet filters in Linux kernel versions 2.1.102 and above.
 -->
Linux の ipchains は、 Linux IPv4 firewalling コードと ipfwadm を
書き換えたものです。
ipfwadm は BSD の ipfw を書き換えたものだったと思います。
ipchains は Linux のカーネル 2.1.102 以降で IP パケットフィルタを
管理するのに必要です。

<!-- 
The older code doesn't deal with fragments, has 32-bit counters (on Intel at least), doesn't allow specification of protocols other than TCP, UDP or ICMP, can't make large changes atomically, can't specify inverse rules, has some quirks, and can be tough to manage (making it prone to user error). Or so the author says.
-->
以前のコードはフラグメント【訳注: fragment: 断片化されたパケット】を
扱えませんし、
(少なくとも Intel 用では) 32 ビットのカウンタしかありませんし、
TCP/UDP/ICMP 以外の仕様のプロトコルを考慮していませんし、
アトミック(瞬間的)に大きく(ルールを)変更することもできませんし、
逆ルールを満たせませんし、いくつか妙な癖がありましたし、
管理しにくい (ユーザのミスを招きやすい) ものだったと
作者は言っています。

【訳注: この一節は
<url url="http://www.linux.or.jp/JF/JFdocs/IPCHAINS-HOWTO-1.html#ss1.2"
name="IPCHAINS-HOWTO 第一章 1.2 なぜ?">
と殆ど同じです。】

<!-- 
I'm not going to get real deep into how to control an IPChains firewall because there is a GREAT!! HOWTO on it at <url url="http://www.rustcorp.com/linux/ipchains/HOWTO.html" 
name="http://www.rustcorp.com/linux/ipchains/HOWTO.html">. I'd just end up duplicating it here. Here are the basics.
-->
私は ipchains を使ったファイアウォールの制御について、ここで深くは述べる
つもりはありません。
この件についてはとてもよく出来た HOWTO が次のところにありますから、
ここでは基本についてだけ述べます。
 <url url="http://netfilter.samba.org/ipchains/HOWTO.html"
name="http://netfilter.samba.org/ipchains/HOWTO.html">に HOWTO があります。

<!-- 
You work with chains by name. You start with three built-in chains input, output and forward which you can't delete.  You can create chains of your own. Rules can then be added and deleted from these rule sets.
-->
チェインは名前で扱います。
まず、input, output そして forward という組み込み済みチェインがあり、
これらは削除できません。
自分でチェインを作ることができます。
そして、これらのチェインのルールセットに対してルールを追加したり
削除していくことができます。

<!-- 
The operations to work on entire chains are;
-->
全てのチェインに対して行える操作は以下の通りです - 

<!-- 
<enum>
<item>Create a new chain (-N). 
<item>Delete an empty chain (-X). 
<item>Change the policy for a built-in chain. (-P). 
<item>List the rules in a chain (-L). 
<item>Flush the rules out of a chain (-F). 
<item>Zero the packet and byte counters on all rules in a chain (-Z). 
</enum>
-->

<enum>
<item>新しいチェインを作る (-N). 
<item>空のチェインを削除する (-X). 
<item>組み込みチェインのポリシーを変更する (-P). 
<item>チェインにあるルールをリストする (-L). 
<item>チェインのルールを全て消します (-F). 
<item>チェインにある全てのルールのパケットとバイト数のカウンタをゼロにする (-Z). 
</enum>

<!-- 
There are several ways to manipulate rules inside a chain:
 -->
チェイン内部でルールを操作するにはいくつかの方法があります - 

<!-- 
<enum>
<item>Append a new rule to a chain (-A). 
<item>Insert a new rule at some position in a chain (-I). 
<item>Replace a rule at some position in a chain (-R). 
<item>Delete a rule at some position in a chain (-D). 
<item>Delete the first rule that matches in a chain (-D). 
</enum>
-->

<enum>
<item>チェインに新しいルールを加える (-A). 
<item>チェインの適当な場所に新しいルールを入れる (-I). 
<item>チェインの適当な場所でルールを置き換える (-R). 
<item>チェインの適当な場所でルールを削除する (-D). 
<item>チェインに適合する最初のルールを削除する (-D). 
</enum>

<!-- 
There are a few operations for masquerading, which are in ipchains for want of a good place to put them:
 -->
ipchains はマスカレーディングの操作の置場所としても良い所なので、
この為の操作がいくつかあります - 

<!-- 
<enum>
<item>List the currently masqueraded connections (-M -L). 
<item>Set masquerading timeout values (-M -S).
</enum>
-->

<enum>
<item>現在のマスカレードされた接続をリストする (-M -L). 
<item> マスカレードのタイムアウト値を設定する (-M -S).
</enum>

<!-- 
There are some timing issues involved in altering firewall rules. If you are not careful, you can let packets through while you are half-way through your changes. A simplistic approach is to do the following: 
-->

ファイアウォールルールの変更に関してはタイミングの問題がいくつかあります。
注意深くやらないと、変更している間に不完全なところからパケットを
通してしまいます。
もっとも単純な方法は次のようにすることです - 

<verb>
     # ipchains -I input 1 -j DENY
     # ipchains -I output 1 -j DENY
     # ipchains -I forward 1 -j DENY
</verb>

<!-- 
 ... make changes ...
 -->

 ... 変更します ...

<verb>
     # ipchains -D input 1
     # ipchains -D output 1
     # ipchains -D forward 1
     # 
</verb>

<!-- 
This drops all packets for the duration of the changes.
 -->
この方法は、変更している間に全てのパケットを落します。

<!-- 
Here a duplicate of the above firewall rules in IPChains.
-->
<!-- ●この部分はこれでよいだろうか -->
<!-- 
大体おっけーではないでしょうか。
ホンのチョコっと書き換えました。(松田)
 -->
これは ipchains について、これまで述べたファイアウォールルールを
まとめたものです。

<!-- 
<verb>
#!/bin/sh
#
# rc.firewall
#
## Flush everything, start from scratch
  /sbin/ipchains -F input
  /sbin/ipchains -F output
  /sbin/ipchains -F forward

## Redirect for HTTP Transparent Proxy
  #$IPCHAINS  -A input -p tcp -s 192.1.2.0/24 -d 0.0.0.0/0 80 -j REDIRECT 8080

## Create your own chain
  /sbin/ipchains -N my-chain
  # Allow email to got to the server
  /sbin/ipchains -A my-chain -s 0.0.0.0/0 smtp -d 192.1.2.10 1024:-j ACCEPT
  # Allow email connections to outside email servers
  /sbin/ipchains -A my-chain -s 192.1.2.10 -d 0.0.0.0/0 smtp -j ACCEPT 	
  # Allow Web connections to your Web Server
  /sbin/ipchains -A my-chain -s 0.0.0.0/0 www -d 192.1.2.11 1024: -j ACCEPT
  # Allow Web connections to outside Web Server
  /sbin/ipchains -A my-chain -s 192.1.2.0/24 1024: -d 0.0.0.0/0 www -j ACCEPT
  # Allow DNS traffic
  /sbin/ipchains -A my-chain -p UDP -s 0.0.0.0/0 dns -d 192.1.2.0/24 -j ACCEPT

## If you are using masquerading
  # don't masq internal-internal traffic
  /sbin/ipchains -A forward -s 192.1.2.0/24 -d 192.1.2.0/24 -j ACCEPT
  # don't masq external interface direct
  /sbin/ipchains -A forward -s 24.94.1.0/24 -d 0.0.0.0/0 -j ACCEPT
  # masquerade all internal IP's going outside
  /sbin/ipchains -A forward -s 192.1.2.0/24 -d 0.0.0.0/0 -j MASQ

## Deny everything else
  /sbin/ipchains -P my-chain input DENY
</verb>
-->

<verb>
#!/bin/sh
#
# rc.firewall の記述。
#
## 全てを破棄して最初から始動する。
  /sbin/ipchains -F input
  /sbin/ipchains -F output
  /sbin/ipchains -F forward

## HTTP 透過プロキシに対してリダイレクトする。
  #$IPCHAINS  -A input -p tcp -s 192.1.2.0/24 -d 0.0.0.0/0 80 -j REDIRECT 8080

## あなた自身のチェインを作る。
  /sbin/ipchains -N my-chain
  # サーバに来る email を許可する。
  /sbin/ipchains -A my-chain -s 0.0.0.0/0 smtp -d 192.1.2.10 1024:-j ACCEPT
  # 外側の email サーバに email 接続を許可する。
  /sbin/ipchains -A my-chain -s 192.1.2.10 -d 0.0.0.0/0 smtp -j ACCEPT 	
  # あなたの web サーバに Web 接続を許可する。
  /sbin/ipchains -A my-chain -s 0.0.0.0/0 www -d 192.1.2.11 1024: -j ACCEPT
  # 外側の Web サーバに Web 接続を許可する。
  /sbin/ipchains -A my-chain -s 192.1.2.0/24 1024: -d 0.0.0.0/0 www -j ACCEPT
  # DNS トラフィックを許可する。
  /sbin/ipchains -A my-chain -p UDP -s 0.0.0.0/0 dns -d 192.1.2.0/24 -j ACCEPT

## マスカレードを使っているなら、
  # 内側から内側へのトラフィックをマスクしない。
  /sbin/ipchains -A forward -s 192.1.2.0/24 -d 192.1.2.0/24 -j ACCEPT
  # 外部インターフェースを直接マスクしない。
  /sbin/ipchains -A forward -s 24.94.1.0/24 -d 0.0.0.0/0 -j ACCEPT
  # 外側に向かう全ての内部 IP をマスカレードする。
  /sbin/ipchains -A forward -s 192.1.2.0/24 -d 0.0.0.0/0 -j MASQ

## 全てを不許可にする。
  /sbin/ipchains -P my-chain input DENY
</verb>

<!-- 
Don't stop here.  This is not a great firewall and I'm sure you have other services you will be providing.  Again, read the IPCHAINS-HOWTO.
-->
ここでやめてはいけません。
これは完璧なファイアウォールではありませんし、あなたは提供している
他のサービスがあるはずです。
繰り返しますが IPCHAINS-HOWTO を読みましょう。

【訳注: 
<url url="http://www.linux.or.jp/JF/JFdocs/IPCHAINS-HOWTO-1.html"
name="IPCHAINS-HOWTO 日本語訳">
もあります。】

<!-- ●(9) -->

<SECT>
<!--
Installing a Transparent SQUID proxy
-->
透過 squid プロキシをインストールする
<p>
<!-- 
The squid proxy is available at <bf> <url url="http://squid.nlanr.net/" name="http://squid.nlanr.net/"></bf>.
-->
squid プロキシは次のところで入手できます。
<bf><url url="ftp://ftp.squid-cache.org/pub/" name="ftp://ftp.squid-cache.org/pub/"></bf>

<!-- 
The squid  developers provide RedHat and Debian packages.  If you can,
use one of these.
-->
SQUID の開発者は RedHat と Debian パッケージを提供しています。
可能ならこれらパッケージのどれかを使用します。

【訳注: 原文では SQUID と大文字で書かれているのですが、
       日本語訳では squid としていますのでご注意ください。
<p>
squid の メインページとFAQ ページは次のところにあります。
 <htmlurl url="http://www.squid-cache.org/" name="http://www.squid-cache.org/">
<newline>
 <htmlurl url="http://www.squid-cache.org/Doc/FAQ/FAQ.html" name="http://www.squid-cache.org/Doc/FAQ/FAQ.html">
】

<!-- ●(10) -->

<sect>
<!-- 
Installing the TIS Proxy server
-->
TIS プロキシサーバをインストールする
<p>

<sect1>
<!-- 
Getting the software
-->
ソフトウェアを入手する

<p>
<!-- 
The TIS FWTK is available at <bf><url url="http://www.tis.com/research/software/ "
name="http://www.tis.com/research/software/"></bf>.
 -->
TIS FWTK は次のところで入手できます。
 <bf><url url="http://www.tis.com/research/software/"
name="http://www.tis.com/research/software/"></bf>

<!-- 
<bf>Don't make the mistake I did.</bf> When you ftp files from TIS, READ THE README's. The TIS fwtk is locked up in a hidden directory on their server.
 -->
私がやったような間違いをしてはいけません。
TIS からファイルを ftp する時、 README をしっかり読んでください。
TIS fwtk はサーバの隠しディレクトリに置かれています。

<!-- 
TIS requires you read their agreement at <url url="http://www.tis.com/research/software/fwtk_readme.html "
name="http://www.tis.com/research/software/fwtk_readme.html"> and then <bf>send email to <URL URL="mailto:fwtk-request@tislabs.com" name="fwtk-request@tislabs.com"> </bf> with only the word <bf>accepted</bf> in the body of the message to learn the name of this hidden directory. No subject is needed in the message. Their system will then mails you back the directory name (good for 12 hours) to download the source.
-->
TIS は、次の場所で <url
url="http://www.tis.com/research/software/fwtk_readme.html"
name="http://www.tis.com/research/software/fwtk_readme.html">
同意書を読み、それから隠しディレクトリの名称を知らせてもらう為に
本文に<bf>同意する(accepted)</bf>とだけ書いて<bf>次のアドレス宛に
メールを送るよう要請しています。
<URL URL="mailto:fwtk-request@tislabs.com"
name="fwtk-request@tislabs.com"> </bf>
subject は不要です。
TIS のシステムはソースをダウンロードできる (12 時間有効の) ディレクトリの
名を書いたメールを返送してきます。

<!-- 
As of this writing, the current version of FWTK is 2.1.
-->
この文書を書いている時点での FWTK の最新版は 2.1 です。

<sect1>
<!-- 
Compiling the TIS FWTK
-->
TIS FWTK をコンパイルする

<p> 
<!-- 
Version 2.1 of the FWTK compiles much easier then any of the older versions. 

EXPLAIN HERE!!!

Now run <bf>make</bf>.
-->
FWTK の Version 2.1 は、旧版のどれよりも簡単にコンパイルできます。

説明はこれだけ!!!

さあ、 <bf>make</bf> を実行しましょう。

<sect1>
<!-- 
Installing the TIS FWTK
  -->
TIS FWTK をインストールする

<p>
<!-- 
Run <bf>make install</bf>.
-->
<bf>make install</bf> を実行しましょう。

<!-- 
The default installation directory is /usr/local/etc. You could change this (I didn't) to a more secure directory. I chose to change the access to this directory to 'chmod 700'.
-->
デフォルトでインストールされるディレクトリは、/usr/local/etc です。
(私は変更はしていませんが) インストールディレクトリはもっと安全な
ディレクトリに変更できます。
私はデフォルトのディレクトリを 'chmod 700' に変更しています。

<!-- 
All last is left now is to configure the firewall.
-->
最後にファイアウォールを設定する仕事が残っています。

<sect1>
<!-- 
Configuring the TIS FWTK
-->
TIS FWTK を設定する

<p> 
<!-- 
Now the fun really begins. We must teach the system to call theses new services and create the tables to control them.
 -->
さて、ここから佳境に入ります。
これらの新しいサービスの呼び出しをシステムに教えてやり、それらを
制御するテーブルを作らなくてはいけません。
 
<!-- 
I'm not going to try to re-write the TIS FWTK manual here. I will show you
 the setting I found worked and explain the problems I ran into and how 
I got around them.
-->
ここで TIS FWTK のマニュアルをもう一度書くつもりはありません。
私が動作を確認した設定、はまりこんだ問題を説明し、それらを回避する
方法についてお伝えします。

<!-- 
There are three files that make up these controls.
 -->
制御を構成する三つのファイルがあります。

<p>
<!-- 
<itemize>
<item>/etc/services
<itemize>
<item>Tells the system what ports a services is on.
</itemize>
</itemize>
<itemize>
<item>/etc/inetd.conf
<itemize>
<item>Tells inetd what program to call when someone knocks on a service port.
</itemize>
</itemize>
<itemize>
<item>/usr/local/etc/netperm-table
<itemize>
<item>Tells the FWTK services who to allow and deny service to.
</itemize>
</itemize>
-->

<itemize>
<item>/etc/services
<itemize>
<item> サービスがどのポートで行われるかをシステムに知らせる。
</itemize>
</itemize>
<itemize>
<item>/etc/inetd.conf
<itemize>
<item> 何者かがサービスポートを叩いたときに、呼び出されるプログラムを
リストしてシステムに知らせる。
</itemize>
</itemize>
<itemize>
<item>/usr/local/etc/netperm-table
<itemize>
<item> サービスを許可と拒否している者を FWTK サービスに知らせる。
</itemize>
</itemize>

<!-- 
To get the FWTK functioning, you should edit these files from the bottom 
up. Editing the services file without the inetd.conf or netperm-table file 
set correctly could make your system inaccessible.
-->
FWTK の機能を使う為に、これらのファイルを手順に従って
編集しなければいけません。
inetd.conf や netperm-table ファイルを正しく設定しないで
サービスファイルを編集すると、お使いのシステムに
アクセスできなくなります。

<sect2>
<!-- 
The netperm-table file
-->
netperm-table ファイル

<p> 
<!-- 
This file controls who can access the services of the TIS FWTK. You should think about the traffic using the firewall from both sides. People outside your network should identify themselves before gaining access, but the people inside your network might be allowed to just pass through.
-->
このファイルは TIS FWTK のサービスにアクセスできる者をコントロールします。
ファイアウォールの両側からのトラフィックについて考えなければいけません。
ネットの外部の人たちはアクセスする前に認証すべきですが、ネットワークの
内部の人たちは単に通過を許可するように設定する場合もあります。

<!-- 
So people can identify themselves, the firewall uses a program called <bf>authsrv</bf> to keep a database of user IDs and passwords. The authentication section of the netperm-table controls where the database is 
keep and who can access it.
-->
そこでユーザが自分自身を認証できるように、ファイアウォールは
ユーザの ID とパスワードのデータベースを保管する <bf>authsrv</bf> と
呼ばれるプログラムを使います。
netperm-table の認証部分は、データベースが保存される場所と、それに
アクセスできる人をコントロールします。

<!-- 
I had some trouble closing the access to this service. Note the premit-hosts line I show uses a '*' to give everyone access. The correct setting for this line is '' <tt>authsrv: premit-hosts localhost</tt> if you can get it working. 
-->
私は、このサービスへのアクセスを止めてしまうトラブルに遭遇しました。
全ての人がアクセスできるように、 '*' を使っている premit-host 行に
注意してください。
動かすことができるようになったならば、この行の正しい設定は 
'' <tt>authsrv: premit-hosts localhost</tt> です。


<verb>
  #
  # Proxy configuration table
  #
  # Authentication server and client rules
  authsrv:	database /usr/local/etc/fw-authdb
  authsrv:	permit-hosts *
  authsrv:	badsleep 1200
  authsrv:	nobogus true
  # Client Applications using the Authentication server
  *:		authserver 127.0.0.1 114
</verb>

<!-- 
To initialize the database, su to root, and run <bf>./authsrv</bf> in the 
/var/local/etc directory to create the administrative user record. Here is
a sample session.
-->
データベースを初期化するため、su で root になります。
そして /var/local/etc で管理用ユーザ記録を作成する為に
<bf>./authsrv</bf> を動かします。
例を示しておきます。

<!-- 
Read the FWTK documentation to learn how to add users and groups.
-->
FWTK の文書を読み users と groups を加える方法について調べてください。

<verb>
    #
    # authsrv
    authsrv# list
    authsrv# adduser admin &dquot;Auth DB admin&dquot;
    ok - user added initially disabled
    authsrv# ena admin
    enabled
    authsrv# proto admin pass
    changed
    authsrv# pass admin &dquot;plugh&dquot;
    Password changed.
    authsrv# superwiz admin
    set wizard
    authsrv# list
    Report for users in database
    user   group  longname           ok?    proto   last 
    ------ ------ ------------------ -----  ------  -----
    admin         Auth DB admin      ena    passw   never
    authsrv# display admin
    Report for user admin (Auth DB admin)
    Authentication protocol: password
    Flags: WIZARD
    authsrv# ^D
    EOT
    #
</verb>

<!-- 
The telnet gateway (tn-gw) controls are straight forward and the first you should set up.
 -->
telnet gateway (tn-gw) コントロールは正確に、しかも最初に設定を
行わなければなりません。
<!-- 「正確」では無いんですが、うまい訳が思いつかないのと誤解を与えるわけではないのでここは修正せず
-->

<!-- 
In my example, I permit host from inside the private network to pass through without authenticating themselves. (permit-hosts 19961.2.* -passok) But, any other user must enter their user ID and password to use the proxy. (permit-hosts * -auth)
-->
私の例では、プライベートネットワーク内部のホストには自身の認証なしで
通過を許可しています(permit-hosts 19961.2.* -passok) 。
しかし、その他のユーザはプロキシを使う為に、自分の ID とパスワードを
入力しなければなりません (permit-hosts * -auth)。

<!-- 
I also allow one other system (192.1.2.202) to access the firewall directly without going through the firewall at all. The two inetacl-in.telnetd lines do this.  I will explain how these lines are called latter.
 -->
ここではまた、一台の別のシステム(192.1.2.202)からはファイアウォールを
通さないで、直接ファイアウォールマシンへのアクセスを許可しています。
二つのinetacl-in.telnetd 行がこれを行います。
どのようにしてこれらの行が呼び出されるかは後で説明します。

<!-- 
The Telnet timeout should be keep short.
-->
telnet のタイムアウトは短くしたほうがよいでしょう。

<!-- 
<verb>
  # telnet gateway rules:
  tn-gw:		denial-msg	/usr/local/etc/tn-deny.txt
  tn-gw:		welcome-msg	/usr/local/etc/tn-welcome.txt
  tn-gw:		help-msg	/usr/local/etc/tn-help.txt
  tn-gw:		timeout 90
  tn-gw:		permit-hosts 192.1.2.* -passok -xok
  tn-gw:		permit-hosts * -auth
  # Only the Administrator can telnet directly to the Firewall via Port 24
  netacl-in.telnetd: permit-hosts 192.1.2.202 -exec /usr/sbin/in.telnetd
</verb>
 -->
<verb>
  # telnet ゲートウェイルール - 
  tn-gw:		denial-msg	/usr/local/etc/tn-deny.txt
  tn-gw:		welcome-msg	/usr/local/etc/tn-welcome.txt
  tn-gw:		help-msg	/usr/local/etc/tn-help.txt
  tn-gw:		timeout 90
  tn-gw:		permit-hosts 192.1.2.* -passok -xok
  tn-gw:		permit-hosts * -auth
  # 管理者だけがポート 24 経由でファイアウォールに直接 telnet できます。
  netacl-in.telnetd: permit-hosts 192.1.2.202 -exec /usr/sbin/in.telnetd
</verb>

<!-- 
The r-commands work the same way as telnet.
-->
(rlogin や rcp や rshなどの)リモート関連コマンドは telnet と
同じような方法で動きます。

<!--
<verb>
  # rlogin gateway rules:
  rlogin-gw:	denial-msg	/usr/local/etc/rlogin-deny.txt
  rlogin-gw:	welcome-msg	/usr/local/etc/rlogin-welcome.txt
  rlogin-gw:	help-msg	/usr/local/etc/rlogin-help.txt
  rlogin-gw:	timeout 90
  rlogin-gw:	permit-hosts 192.1.2.* -passok -xok
  rlogin-gw:	permit-hosts * -auth -xok
  # Only the Administrator can telnet directly to the Firewall via Port
  netacl-rlogind: permit-hosts 192.1.2.202 -exec /usr/libexec/rlogind -a
</verb>
 -->
<verb>
  # rlogin ゲートウェイルール - 
  rlogin-gw:	denial-msg	/usr/local/etc/rlogin-deny.txt
  rlogin-gw:	welcome-msg	/usr/local/etc/rlogin-welcome.txt
  rlogin-gw:	help-msg	/usr/local/etc/rlogin-help.txt
  rlogin-gw:	timeout 90
  rlogin-gw:	permit-hosts 192.1.2.* -passok -xok
  rlogin-gw:	permit-hosts * -auth -xok
  # 管理者だけがポートを通じてファイアウォールに直接 telnetできます。
  netacl-rlogind: permit-hosts 192.1.2.202 -exec /usr/libexec/rlogind -a
</verb>

<!-- 
You shouldn't have anyone accessing your firewall directly and that includes FTP so don't put an FTP, server on you firewall. 
-->
 FTP も含め、ファイアウォールを直接アクセスできるようにすべきではありません。
そのためファイアウォールに FTP サーバを置いてはいけません。

<!-- 
Again, the permit-hosts line allows anyone in the protected network free access to the Internet and all others must authenticate themselves. I included logging of every file sent and received to my controls. (-log { retr stor })
-->
次の permit-hosts 行は、保護されたネットワーク内に居る全ての者に
インターネットへの自由なアクセスを許可し、その他の者は自分自身を
認証しなければなりません。
私は送受信した全てのファイルの記録を取る設定も含めてあります。
(-log { retr stor })
<!-- 
「インターネットへの自由なアクセスを保護されたネットワーク内で
全ての者に許可し、」
誤解しそうな表現ですので改めました。(松田)
 -->

<!-- 
The ftp timeout controls how long it will take to drop a bad connections as well as how long a connection will stay open with out activity.
-->
ftp のタイムアウトは、接続が入力がないままオープンになっている時間を
どれくらいにするのかと同じように、不正な接続を停止するのに必要な時間を
どれくらいにするかを制御します。

<verb>
  # ftp gateway rules:
  ftp-gw:		denial-msg	/usr/local/etc/ftp-deny.txt
  ftp-gw:		welcome-msg	/usr/local/etc/ftp-welcome.txt
  ftp-gw:		help-msg	/usr/local/etc/ftp-help.txt
  ftp-gw:		timeout 300
  ftp-gw:		permit-hosts 192.1.2.* -log { retr stor }
  ftp-gw:		permit-hosts * -authall -log { retr stor }
</verb>

<!-- 
Web, gopher and browser based ftp are contorted by the http-gw. The first two lines create a directory to store ftp and web documents as they are passing through the firewall. I make these files owned by root and put the in a directory accessible only by root.
-->
Web, gopher, ブラウザを使った ftp は http-gw によって制御されます。
最初の二行は ftp やファイアウォールを通って渡されているような web 文書を
置くディレクトリを作ります。
私はこれらのファイルを root 所有にし、root のみがアクセスできる
ディレクトリに置いています。

<!-- 
The Web connection should be kept short. It controls how long the user will wait on a bad connections.
-->
Web 接続は短くしたほうがよいでしょう。
ユーザが不正な接続でどれくらい待つかを制御します。

<verb>
  # www and gopher gateway rules:
  http-gw:	userid		root
  http-gw:	directory	/jail
  http-gw:	timeout 90
  http-gw:	default-httpd	www.afs.net
  http-gw:	hosts 		192.1.2.* -log { read write ftp }
  http-gw:	deny-hosts 	* 
</verb>

<!-- 
The ssl-gw is really just a pass anything gateway. Be carefully with it. In this example I allow anyone inside the protected network to connect to any server outside the network except the addresses 127.0.0.* and 192.1.1.* and then only on ports 443 through 563. Ports 443 through 563 are known SSL 
ports.
-->
ssl-gw は実際はなんでも通してしまう gateway です。
注意してください。
この例では、私はアドレス 127.0.0.* と 192.1.1.* それから、ポート 443 から
 563 上でだけ、ネットワークの外部のどのサーバにも接続するため保護された
ネットワークの内部で全ての人を許可しています。
ポート 443 から 563 は SSL ポートです。

<verb>
  # ssl gateway rules:
  ssl-gw:         timeout 300
  ssl-gw:         hosts           192.1.2.* -dest { !127.0.0.* !192.1.1.* *:443:563 }
  ssl-gw:         deny-hosts      *
</verb>

<!-- 
Here is an example of how to use the plug-gw to allow connections to a news server.  In this example I allow anyone inside the protected network to connect to only one system and only to it's news port.
-->
ここでは、新しいサーバに接続を許可する為に plug-gw をどのように
使うかについての例を示します。
この例で、私は保護されたネットワークの内側で一つのシステムにだけ接続し、
それが新しいポートにだけ接続するのを全ての人に許可します。

<!-- 
The seconded line allows the news server to pass its data back to the protected network.
-->
二行目は保護されたネットワークにそのデータを戻す為に新しいサーバを許可します。

<!-- 
Because most clients expect to stay connected while the user read news, the timeout for a news server should be long.
-->
殆どのクライアントはユーザがニュースを読んでいる間は接続状態に
あることを期待しますから、ニュースサーバのタイムアウトは長くしておくべきです。

<verb> 
  # NetNews Pluged gateway
  plug-gw:        timeout 3600
  plug-gw: port nntp 192.1.2.* -plug-to 24.94.1.22 -port nntp
  plug-gw: port nntp 24.94.1.22 -plug-to 192.1.2.* -port nntp
</verb>

<!-- 
The finger gateway is simple. Anyone inside the protected network must  login first and then we allow them to use the finger program on the firewall. Anyone else just gets a message.
-->
finger gateway はシンプルです。
保護されたネットワークの内部の人は誰でも最初にログインしなければならず、
その後ファイアウォール上の finger プログラムを使うことができます。
それ以外の全ての人は次のようなメッセージを受け取ります。

<verb>
  # Enable finger service 
  netacl-fingerd: permit-hosts 192.1.2.* -exec /usr/libexec/fingerd
  netacl-fingerd: permit-hosts * -exec /bin/cat /usr/local/etc/finger.txt
</verb>

<!-- 
I haven't setup the Mail and X-windows services so I'm not including examples.  If anyone has a working example, please send me email.
-->
私は Mail と X Window System のサービスの設定をしていないので、ここには例を
含めていません。
どなたか動いている例をお持ちなら e-mail で私に送ってください。
 
<sect2>
<!-- 
The /etc/services file
-->
/etc/services ファイル

<p> 
<!-- 
This is where it all begins. When a client connects to the firewall it connects on a known port (less then 1024).  For example telnet connects on port 23. The inetd deamon hears this connection and looks up the name of these service in the /etc/services file. It then calls the program assigned to the name in the /etc/inetd.conf file.
-->
ここが全ての始まりです。クライアントがファイアウォールに接続するとき、
既知のポート( 1024 より以下)に接続します。たとえばtelnet はポート23 上に
接続します。inetd デーモンはこの接続を知ると、 /etc/services ファイルに
あるこれらのサービスの名前を探します。それから /etc/inetd.conf ファイルに
ある名前に割り当てられたプログラムを呼び出します。

<!-- 
Some of the services we are creating are not normally in the /etc/services file. You can assign some of them to any port you want. For example, I have assigned the administrator's telnet port (telnet-a) to port 24. You could assign it to port 2323 if you wished. For the administrator (YOU) to connect directly to the firewall you will need to telnet to port 24 not 23 and if you setup your netperm-table file, like I did, you will only be able to this from one system inside your protected network.
-->
われわれが作成しているサービスのあるものは、普通は /etc/services
ファイルにはありません。
あなたは、自分が望むどれかのポートに何かのサービスを割り当てることが
できます。
例えば、私は管理者の telnet ポート (telnet-a) をポート24 に割り当てています。
お望みならポート 2323 にそれを割り当てることもできます。
ファイアウォールに直接接続する管理者(あなた)に対して、私が行ったように、
あなたがご自分の netperm-table ファイルを設定するならポート23 ではなく、
ポート24 にtelnet する必要があり、保護されたネットワークの内部で、
一つのシステムからこれをできるようにするだけです。

<p>
<verb> 
  telnet-a        24/tcp
  ftp-gw          21/tcp    	   # this named changed
  auth            113/tcp   ident    # User Verification
  ssl-gw          443/tcp
</verb>


<!-- ●(11) -->
<sect>
<!-- 
The SOCKS Proxy Server
-->
 SOCKS プロキシサーバ

<p>
<sect1>
<!-- 
Setting up the Proxy Server
-->

プロキシサーバを設定する
<p>
<!-- 
The SOCKS proxy server available from 
<bf>http://www.socks.nec.com/</bf>.
  -->

 SOCKS プロキシサーバは次のところから入手できます。
<bf>http://www.socks.nec.com/</bf>

<!-- 
Uncompressed and untar the files into a directory on your system, and follow the instructions on how to make it.  I had a couple problems when I made it.  Make sure that your Makefiles are correct.
-->
お使いのシステムのディレクトリでファイルを解凍、展開し、指示にしたがって 
make してください。私が行ったときは少し問題ありました。Makefile が正しい
ことを確認してください。

<!-- 
One important thing to note is that the proxy server needs to be added to /etc/inetd.conf.  You must add a line:
-->

一つ大事なことは、プロキシサーバは /etc/inetd.conf に追加しなければいけません。
要求があったとき稼働するようサーバに伝えるため、次の行を追加してください - 

<verb>
  socks  stream  tcp  nowait  nobody  /usr/local/etc/sockd  sockd
</verb>

<!-- 
to tell the server to run when requested.
-->


<sect1>
<!-- 
Configuring the Proxy Server
-->
プロキシサーバを設定する

<p> 
<!-- 
The SOCKS program needs two separate configuration files.  One to tell the access allowed, and one to route the requests to the appropriate proxy server.  The access file should be housed on the server.  The routing file should be housed on every UNIX machine.  The DOS and, presumably, Macintosh computers will do their own routing.
-->
SOCKS プログラムには二つの独立した設定ファイルが必要です。
一つはアクセスを許可したことを伝え、もう一つは適切なプロキシサーバへの
要求に対して経路を決めるものです。
ルーティングファイルは全ての UNIX マシンに置かれていなくてはいけません。
DOS と、たぶんマッキントッシュは自分でルーティングを行うでしょう。

<sect2>
<!-- 
The Access File
-->
アクセスファイル
<p>
<!-- 
With socks4.2 Beta, the access file is called &dquot;sockd.conf&dquot;.It should contain 2 lines, a permit and a deny line.   Each line will have three entries:
-->

socks4.2 Beta では、アクセスファイルは &dquot;sockd.conf&dquot; という
名前になっています。許可と拒否行の 2行があります。それぞれの行は三つの
エントリーを持ちます。

<itemize>
<item>The Identifier (permit/deny)
<item>The IP address
<item>The address modifier
</itemize>

<!-- 
The identifier is either permit or deny.  You should have both a permit and a deny line.
-->

Identifier は許可か拒否(permit/deny)のどちらかです。許可と拒否の両方
を書くようにしなければなりません。


<!-- 
The IP address holds a four byte address in typical IP dot notation. I.E. 
192.168.1.0.
-->

IP アドレスは通常の IP 10 進ドット記法 で 4 バイトアドレスで書かれます。
例えば、192.168.1.0 のようになります。

<!-- 
The address modifier is also a typical IP address four byte number. It works like a netmask.  Envision this number to be 32 bits (1s or 0s). If the bit is a 1, the corresponding bit of the address that it is checking must match the corresponding bit in the IP address field. For instance, if the line is:
-->
アドレス修正もまた通常の IP アドレス 4 バイト長です。
ネットマスクのように働きます。
32 bits (1 または 0 など)になるようにこの数値を想定しています。
bit が 1 なら、予約されているアドレスに対応する bit は、IP アドレスの
領域で対応する bit に一致しなければいけません。
例えば、次のような行の場合 - 

<verb>
    permit 192.168.1.23 255.255.255.255
</verb>

<!-- 
it will permit only the IP address that matches every bit in 192.168.1.23, eg, only 192.168.1.3.  The line:
-->
192.168.1.23 に全ての bit が一致する IP アドレス、つまり
192.168.1.23 だけが許可されます。次のような行の場合では - 
<!-- 単なる誤記 -->

<verb>
    permit 192.168.1.0 255.255.255.0
</verb>

<!-- 
will permit every number within group 192.168.1.0 through 192.168.1.255, the whole C Class domain.   One should not have the line:
-->
192.168.1.255 から 192.168.1.0 のグループ内にある C クラスのドメインの
全ての数値を許可します。 
次のような行を書くべきではありません - 

<verb>
    permit 192.168.1.0 0.0.0.0
</verb>

<!-- 
as this will permit every address, regardless.
-->
この場合は、全てのアドレスをおかまいなしに許可してしまいます。

<!-- 
So, first permit every address you want to permit, and then deny the
  rest.  To allow everyone in the domain 192.168.1.xxx, the lines: 
-->
そこで、まず許可したい全てのアドレスを許可し、それから、残りを
拒否します。
ドメイン 192.168.1.xxx で、全てを許可するには次のようにします - 

<verb>
    permit 192.168.1.0 255.255.255.0
    deny 0.0.0.0 0.0.0.0
</verb>

<!-- 
will work nicely.  Notice the first &dquot;0.0.0.0&dquot; in the deny line.  With a modifier of 0.0.0.0, the IP address field does not matter.  All 0's is the norm because it is easy to type.
-->
これはうまく動くでしょう。
拒否行にある最初の  &dquot;0.0.0.0&dquot; に注意してください。
アドレス修正が 0.0.0.0 になっているので、IP アドレス領域は意味を持ちません。
通常全て 0 で、これは入力が簡単なためです。

<!-- 
More than one entry of each is allowed.
-->

どちらに対してもふたつ以上のエントリを指定することができます。

<!-- 
Specific users can also be granted or denied access.  This is done via ident authentication.  Not all systems support ident, including Trumpet Winsock, so I will not go into it here.  The documentation with socks is 
quite adequate on this subject.
-->

特別なユーザもまた許可あるいは拒否することができます。これは ident 認証
を通して行われます。Trumpet Winsock もそうですが、ident をサポートしてい
ないシステムがあるため、私はここでそれについては述べません。
この件については、socks 付属の文書がふさわしいでしょう。

<sect2>
<!-- 
The Routing File
-->
ルーティングファイル

<p> 
<!-- 
The routing file in SOCKS is poorly named &dquot;socks.conf&dquot;.  I say &dquot;poorly named&dquot; because it is so close to the name of the access file that it is easy to get the two confused.
-->

SOCKS のルーティングファイルは &dquot;socks.conf&dquot; というあまりよく
ない名前になっています。私が、&dquot;あまりよくない名前&dquot; だと言う
のは、アクセスファイルの名前によく似ているので、この二つが混乱しやすい
という理由からです。

<!-- 
The routing file is there to tell the SOCKS clients when to use socks and when not to.  For instance, in our network, 192.168.1.3 will not need to use socks to talk with 192.168.1.1, firewall.  It has a direct connection in via Ethernet.  It defines 127.0.0.1, the loopback, automatically.  Of course you do not need SOCKS to talk to yourself. There are three entries:
-->

ルーティングファイルは SOCKS クライアントに socks を使用すべきときと、
使わなくていいときを伝える為にあります。例えば、われわれのネットワークで、
192.168.1.3 が 192.168.1.1 のファイアウォールと話す為に socks を使う必要
はありません。イーサネットを通して直接つながっています。127.0.0.1は
loopback として自動的に定義されます。もちろん自分自身と話す為に SOCKS は
必要ではありません。ここには三つのエントリー群があります。

<p>
<itemize>
<item>deny
<item>direct
<item>sockd
</itemize>

<!-- 
Deny tells SOCKS when to reject a request.  This entry has the same three fields as in sockd.conf, identifier, address and modifier. Generally, since this is also handled by sockd.conf, the access file, the modifier field is set to 0.0.0.0.  If you want to preclude yourself from calling any place, you can do it here.
-->

拒否(deny)は SOCKS に要求を拒否する場合を伝えます。このエントリーには、
sockd.conf ファイル内で、identifier 、address そして、modifier の三つの
部分があります。これは一般的に sockd.conf 、つまりアクセスファイルによっ
ても扱われるので、アドレス修正フィールドは 0.0.0.0 に設定されます。どこか
らでも呼び出されないよう自分自身を除外したいなら、ここで設定できます。

<!-- 
The direct entry tells which addresses to not use socks for.  These are all the addresses that can be reached without the proxy server. Again we have the three fields, identifier, address and modifier.  Our example would have
-->

direct エントリーは、どのアドレスが socks を使わないかを伝えます。
プロキシサーバなしに到達できる全てのアドレスがあります。
ここでもまた identifier、address、modifierの三つの部分があります。
わわわれの例では次のようになっています。


<verb>
    direct 192.168.1.0 255.255.255.0
</verb>

<!-- 
Thus going direct for any on our protected network.
-->

あなたの保護されたネットワーク上では誰に対しても直接接続します。
 
<!-- 
The sockd entry tells the computer which host has the socks server daemon on it.  The syntax is:
-->

 sockd のエントリーはどのホストが socks サーバデーモンを持っているかを
コンピュータに伝えます。構文は次のようになります。

<verb>
  sockd @=<serverlist> <IP address> <modifier>
</verb>

<!-- 
Notice the @= entry.  This allows you to set the IP addresses of a list of proxy servers.  In our example, we only use one proxy server. But, you can have many to allow a greater load and for redundancy in case of failure.
-->

@= というエントリーに注意してください。これはプロキシサーバのリストの 
IP アドレスの設定を許可します。われわれの例では、一つのプロキシサーバ
を使うだけですが、あなたはより大きな負荷を許可することで多数持つように
でき、失敗した場合の繰り返しのため複数で指定することもできます。

<!-- 
The IP address and modifier fields work just like in the other examples.  You specify which addresses go where through these. 6.2.3.  DNS from behind a Firewall
-->

IP アドレスと modifier の部分は、別に示した例と同様に動きます。
どのアドレスが通過していくかを指定します。


<!-- 
6.2.3.  DNS from behind a Firewall
-->
<sect2> ファイアウォールの後ろで DNS を動かす
<p>
<!-- ここは原文のミスのようです。6.2.3 になる-->
<!-- 
Setting up Domain Name service from behind a firewall is a relatively simple task.  You need merely to set up the DNS on the firewalling machine.  Then, set each machine behind the firewall to use this DNS.
-->
ファイアウォールの後ろで DNS(ドメインネームサーバ)を設定するのは、比較的
簡単なことです。ただ単にファイアウォールマシンに DNS を設定すればよいだ
けです。このように DNS を使う為にファイアウォールの後ろ側でそれぞれのマ
シンを設定します。

<sect1>
<!-- 
Working With a Proxy Server
-->
プロキシサーバを動かす
<p>
<sect2>
Unix

<p> 
<!-- 
To have your applications work with the proxy server, they need to be &dquot;sockified&dquot;.  You will need two different telnets, one for direct communication, one for communication via the proxy server.  SOCKS comes with instructions on how to SOCKify a program, as well as a couple pre-SOCKified programs.  If you use the SOCKified version to go somewhere direct, SOCKS will automatically switch over to the direct version for you.  Because of this, we want to rename all the programs on our protected network and replace them with the SOCKified programs. &dquot;Finger&dquot; becomes &dquot;finger.orig&dquot;, &dquot;telnet&dquot; becomes &dquot;telnet.orig&dquot;, etc. You must tell SOCKS about each of these via the include/socks.h file.
-->
 プロキシサーバでアプリケーションを動かす為には、
&dquot;SOCKS 化(sockified) &dquot;が必要です。
直結のコミュニケーション用に一つと、プロキシサーバを通しての
コミュニケーション用の二種類の telnet
 が必要です。SOCKS にはプログラムをどのように SOCK 化するかについての手順
書と、数個のSOCKS 化されていないプログラムを同封しています。
あなたがどこかに直接接続するためSOCKS 化された版を使うなら、 SOCKS は自動
的にあなたの為に直接接続用の版に変更するでしょう。このため、保護された
ネットワーク上で全ての関連プログラムをリネームし、もともとの名前のものを
 SOCK 化されたプログラムで置き換えたいわけです。
 &dquot;Finger&dquot; は  &dquot;finger.orig&dquot;, に、
 &dquot;telnet&dquot; は  &dquot;telnet.orig&dquot;, のようになります。
これらを include/socks.h でそれぞれについて SOCKS に伝えてやらなくては
いけません。

<!-- 
Certain programs will handle routing and sockifying itself.  Netscape is one of these.  You can use a proxy server under Netscape by entering the server's address (192.168.1.1 in our case) in the SOCKs field under Proxies.  Each application will need at least a little messing with, regardless of how it handles a proxy server.
-->
ある種のプログラムはそれ自身でルーティングと SOCKS 化を処理します。
Netscape はそれらの一つです。 Netscape でプロキシのもとで SOCK の場所
にサーバのアドレス(われわれの場合は、192.168.1.1 )を入力してプロキシサー
バを使うことができます。少なくともそれぞれのアプリケーションは、プロキシ
サーバをどのように使うかに関わらず、多少の試行錯誤は必要です。
<!-- ここはよく分からない。原訳は違うと思うけど。-->


<sect2>
<!-- 
MS Windows with Trumpet Winsock
-->
Trumpet Winsock を持った MS Windows
<p> 
<!-- 
Trumpet Winsock comes with built in proxy server capabilities.  In the &dquot;setup&dquot; menu, enter the IP address of the server, and the addresses of all the computers reachable directly.  Trumpet will then handle all outgoing packets.
-->
Trumpet Winsock にはプロキシサーバを扱う機能が組み込まれています。
&dquot;セットアップ&dquot;メニューで、サーバの IP アドレスと、直接的に
到達可能な全てのコンピュータのアドレスを入力します。そうすれば 
Trumpet は外に向かう全てのパケットを扱います。

【訳注: Trumpet Winsock は Windows 3.1 の為の TCP/IP プロトコルスタック
ソフトウェアです。
詳細は
<url url="http://www.naoe.hiroshima-u.ac.jp/staffs/hirata/pc-tcpip/"
name="PC-TCPIP-FAQ-J">
をご覧ください。】

<sect2>
<!-- 
Getting the Proxy Server to work with UDP Packets
-->
 UDP パケットで動かす為にプロキシサーバを入手する
<p> 
<!-- 
The SOCKS package works only with TCP packets, not UDP.  This makes it quite a bit less useful.  Many useful programs, such as talk and Archie, use UDP.  There is a package designed to be used as a proxy server for UDP packets called UDPrelay, by Tom Fitzgerald &lt;fitz@wang.com&gt;.  Unfortunately, at the time of this writing, it is not compatible with Linux.
-->

 SOCKS パッケージはTCP パケットだけを処理し、UDP は扱いません。このため、
このパッケージが全く役にたたない場面が出てきます。talk や Archie のような
多くの有用なプログラムは UDP を使います。Tom Fitzgerald
 &lt;fitz@wang.com&gt; さんによって、 UDP relay と呼ばれる UDP パケットに対
してプロキシサーバとして使うように設計されたパッケージが作成されています。
ただし、残念ですが、この文書を書いている時点では Linux との互換性はありません。

<sect1>
<!-- 
Drawbacks with Proxy Servers
-->
プロキシサーバの欠点

<p> 
<!-- 
The proxy server is, above all, a <tt>security device</tt>.  Using it to increase internet access with limited IP addresses will have many drawbacks.  A proxy server will allow greater access from inside the protected network to the outside, but will keep the inside completely inaccessible from the outside.  This means no servers, talk or archive connections, or direct mailing to the inside computers.  These drawbacks might seem slight, but think of it this way:
-->
<!-- ここは archive ではなく、archie だと思う -->

プロキシサーバはとりわけ<tt>セキュリティデバイス</tt> です。限られた IP
アドレスでインターネットへのアクセスを増やす為にプロキシを使うのは、多
くの欠点も伴います。プロキシサーバは保護されたネットワークの内部から外
部へより多くのアクセスを許可しますが、外部からは完全に内部がアクセスできま
せん。このようにするとサーバが使えない、 talk や archieへの接続ができない、
あるいは内部のコンピュータに直接メールできないということになります。これら
の欠点は取るにたらないことのようにも思えますが、次のように考えて見てください。

<itemize>
<item>
<!-- 
You have left a report you are doing on your computer inside a firewall protected network.  You are at home, and decide that you would like to go over it.  You can not.  You can not reach your computer because it is behind the firewall.  You try to log into <tt>firewall</tt> first, but since everyone has proxy server access, no one has set up an account for you on it.
-->
あなたはファイアウォールで保護されたネットワークの内部にある
コンピュータに、現在取りかかっているレポートを忘れてきました。
今は家にいて、ファイアウォールを越えようと決心したのですが、どうやっても
越えられません。
コンピュータはファイアウォールの向こう側にあるのでアクセスできません。
さもなければと<tt>ファイアウォール</tt>にログインしようとしますが、
ファイアウォールには誰もがプロキシサーバ経由でアクセスしますから、
ファイアウォールマシンにはあなたのアカウントが設定されていないため
ログインもできません。

<p>
<item>
<!-- 
Your daughter goes to college.  You want to email her.  You have some private things to talk about, and would rather have your mail sent directly to your machine.  You trust your systems administrator completely, but still, this is private mail.
-->
あなたの娘は大学に行っています。あなたは彼女に email を送りたいとします。
何かプライベートな用件を伝えたいので、あなたのメールを直接娘のマシン
に送りたいのです。あなたはシステム管理者を完全に信頼していますが、
それでもなお、これはプライベートなメールなのですから。
<p>
<item>
<!-- 
The inability to use UDP packets represents a big drawback with the proxy servers.  I imagine UDP capabilities will be coming shortly.
 -->
UDP パケットを使うことができないというのは、プロキシサーバのもつ
大きな欠点です。私は UDP を扱う機能はまもなく到来するだろうと思っています。
</itemize>

<!-- 
FTP causes another problem with a proxy server.  When getting or doing an <tt>ls</tt>, the FTP server opens a socket on the client machine and sends the information through it.  A proxy server will not allow this, so FTP doesn't particularly work.-->

FTP はプロキシサーバで別の問題を起こします。<tt>ls</tt>を使うと、 FTP サー
バはクライアントマシン上でソケットを開き、そこから情報を送ります。プロキ
シサーバはこれを許可していませんので、 FTP はこの場合には動きません。

<!-- 
And, proxy servers run slow.  Because of the greater overhead, almost any other means of getting this access will be faster.
-->
更に、プロキシサーバは遅いです。
他のどんな方法よりもオーバヘッドが大きくなるので、
プロキシサーバ経由以外の手段でアクセスする方が速くなります。

<!-- 
Basically, if you have the IP addresses, and you are not worried about security, do not use a firewall and/or proxy servers.  If you do not have the IP addresses, but you are also not worried about security, you might also want to look into using an IP emulator, like Term, Slirp or TIA.  Term is available from  <tt><bf>ftp://sunsite.unc.edu</bf></tt>, Slirp is available from <tt><bf>ftp://blitzen.canberra.edu.au/pub/slirp</bf></tt>, and TIA is available from marketplace.com.  These packages will run faster, allow better connections, and provide a greater level of access to the inside network from the internet.  Proxy servers are good for those networks which have a lot of hosts that will want to connect to the internet on the fly, with one setup and little work after that.
-->

基本的に、あなたが IP アドレスを持っていても、セキュリティについて悩んで
いないなら、ファイアウォールやプロキシサーバを使わなくてよいのです。IP 
アドレスを持っていないなら、セキュリティについてもまた悩まないでしょう
が、Term, Slirp や TIA のような IP エミュレータを使ってみたいでしょう。
Term は<url url="ftp://sunsite.unc.edu" name="ftp://sunsite.unc.edu">で
入手できます。Slirp は<url
 url="ftp://blitzen.canberra.edu.au/pub/slirp"
 name="ftp://blitzen.canberra.edu.au/pub/slirp">から入手できます。 
TIA  は marketplace.com で入手できます。

これらのパッケージはより高速に動き、よりよい接続を許可し、インターネット
から内部ネットワークにより多くのアクセスを提供します。プロキシサーバは設
定と維持に手間がかからないので、手っ取り早くインターネットに接続したい多
くのホストを持っているようなネットワークにとっては便利なものです。

<!-- 12-16 章-->
<!-- (12) -->
<!--
<sect>Advanced Configurations
-->
<sect>上級の設定

<p>
<!--
There is one configuration I would like to go over before wrapping this document up.  The one I have just outlined will probably suffice for most people.  However, I think the next outline will show a more advanced configuration that can clear up some questions.  If you have questions beyond what I have just covered, or are just interested in the versatility of proxy servers and firewalls, read on.
-->
この文書を締めくくる前に、検討したい設定があります。
多分、今までの概要の説明で大部分の人は足りるでしょう。
しかし、次の項でいくつかの疑問を解決できるもっと上級の設定を示そうと
思います。
今まで説明してきたことだけではあなたの疑問を解決できないのなら、あるいは、
プロキシサーバとファイアウォールによってどれほど多彩な設定が
可能なのかという点に興味があるなら、もうすこし読んでみてください。

<!--
<sect1>A large network with emphasis on security
-->
<sect1>安全性の重視が必要な大きなネットワーク

<p>
<!--
Say, for instance, you are the leader of millisha and you wish to network  your site.  You have 50 computers and a subnet of 32 (5 bits) IP numbers.  You need various levels of access within your network because you tell your followers different things. Therefore, you'll need to protect certain parts of the network from the rest.
-->
さて、例として、あなたは millisha という結社のリーダーで、サイトを
ネットワークに接続したいと思っています。
50 台のコンピュータと 32 個 (5 ビット) の IP 番号のサブネットがあります。
信望者に異なることを言う理由から、ネットワーク内での様々なアクセスの
レベルが必要です。
その結果、ネットワークの特定部分をそれ以外の部分から保護する必要が
あるでしょう。

<!--
The levels are:
-->
そのレベルは -

<!--TODO evail は evil の typo? -->
<!--TODO lown care は lawn care の typo? -->
<!--
<enum>
<item>The external level.  This is the level that gets shown to everybody. This is where you rant and rave to get new volunteers.

<item><bf>Troop</bf>  This is the level of people who have gotten beyond the external level.  Here is where you teach them about the evail government and how to make bombs.

<item><bf>Mercenary</bf>  Here is where the <em>real</em> plans are keep. In this level is stored all the information on how the 3rd world government is going to take over the world, your plans involving Newt Gingrich, Oklahoma City, lown care products and what really is stored in that hangers at area 51.
</enum>
-->
<enum>
<item>external(外部) レベル。誰でも見れるレベルです。新しい志願者を募る
為に、情熱的な演説や派手なパフォーマンスを行なって、一般大衆に自分達の
イメージをはっきりと印象づけるための場所です。

<item><bf>Troop(実行部隊)</bf> external レベルを越えた人たちのレベルです。
ここは邪悪な方法での人心掌握や、爆弾の製造方法について教えるところです。

<item><bf>Mercenary(参謀本部)</bf>  ここは<em>本当の</em>計画を保持し
ています。このレベル内には、世界征服の方法、世間を騒がせた事件の真相な
どの全ての情報が保持されています。

【訳注: 訳文は日本向けであることを
鑑み原文と違っています。原文は以下のとおり - Here is where the
<em>real</em> plans are keep. In this level is stored all the
information on how the 3rd world government is going to take over the
world, your plans involving Newt Gingrich, Oklahoma City, lown care
products and what really is stored in that hangers at area 51.】
</enum>

<!--
<sect2>The Network Setup
-->
<sect2>ネットワーク設定

<p>
<!--
The IP numbers are arranged as:
-->
IP 番号の取り決め -
<p>
<!--
<itemize>
<item>1 number is 192.168.1.255, which is the broadcast address and is
not usable.
<item>23 of the 32 IP addresses are allocated to 23 machines that will be
accessible to the internet.
<item>1 extra IP goes to a Linux box on that network
<item>1 extra goes to a different Linux box on that network.
<item>2 IP &num;'s go to the router
<item>4 are left over, but given domain names paul, ringo, john, and
george, just to confuse things a bit.
<item>The protected networks both have the addresses 192.168.1.xxx
</itemize>
-->
<itemize>
<item>番号の 1 つである 192.168.1.255 は、ブロードキャストアドレスなので
使用できません。
<item>32 個の IP アドレスの内 23 個は 23 台のマシンに割り当てます。これ
らのマシンはインターネットにアクセスできるようにします。
<item>1 個の extra(特別な) IP アドレスをネットワーク上の Linux box に与
えます。
<item>1 個の extra IP アドレスをネットワーク上の異なる Linux box に与え
ます。
<item>2 個の IP アドレスをルータに与えます。
<item>4 個残ってますが、ドメイン名 paul, ringo, john, george に与えま
す。これはちょっと面食らわしただけです。
<item>保護された両方のネットワークはアドレス 192.168.1.xxx です。
</itemize>

<!--
Then, two separate networks are built, each in different rooms.  They are routed via infrared Ethernet so that they are completely invisible to the outside room.  Luckily, infrared ethernet works just like normal ethernet.
-->
次に、分離した 2つのネットワークを、それぞれ異なった部屋に構築します。
2つのネットワークは赤外線イーサネットを使って接続されます。
なので、ネットワークは部屋の外部から完全に隠されます。
幸いにも赤外線イーサネットは、普通のイーサネットと全く同様に動作します。

<!--
These networks are each connected to one of the Linux boxes with an extra IP address.
-->
これらのネットワークは、extra IP アドレスを使って Linux box の 1つに
接続されます。

<!--
There is a file server connecting the two protected networks.  This is because the plans for taking over the world involves some of the higher Troops.  The file server holds the address 192.168.1.17 for the Troop network and 192.168.1.23 for the Mercenary network.  It has to have different IP addresses because it has to have different Ethernet cards.  IP Forwarding on it is turned off.
-->
保護された 2つのネットワークが接続されたファイルサーバがあります。
Troop 以上の人々が関与する世界征服計画用のサーバです。
ファイルサーバは Troop ネットワーク用に 192.168.1.17 のアドレスを、
Mercenary ネットワーク用に 192.168.1.23 を持っています。
異なるイーサネットカードを持たなければならないので、異なる IP アドレスを
持たなければなりません。
その IP Forwarding はオフにします。

<!--TODO vica versa は vice versa の typo? -->
<!--
IP Forwarding on both Linux boxes is also turned off.  The router will not forward packets destined for 192.168.1.xxx unless explicitly told to do so, so the internet will not be able to get in.  The reason for turning off IP Forwarding here is so that packets from the Troop's network will not be able to reach the Mercenary network, and vica versa.
-->
両方の Linux box の IP Forwarding もオフにします。
ルータは特に指定しない限り 192.168.1.xxx に向かうパケットは転送しないので、
インターネットから入って来れません。
IP Forwarding をオフにすることは、Troop ネットワークからのパケットを 
Mercenary ネットワークに到達させないことと、その逆の流れもさせないことを
意味します。

<!--
The NFS server can also be set to offer different files to the different networks.  This can come in handy, and a little trickery with symbolic links can make it so that the common files can be shared with all.  Using this setup and another ethernet card can offer this one file server for all three networks.
-->
また、異なるネットワークに異なるファイルを提供する設定を NFS サーバにも
できます。
これは役立つことで、シンボリックリンクを用いたちょっとした要領で、
普通のファイルを全て共有することができます。
この設定ともう一枚のイーサネットカードを用いることで、 3つ全ての
ネットワークにこの一台のファイルサーバでファイルを提供することができます。

<!--
<sect2>The Proxy Setup
-->
<sect2>プロキシ設定

<p>
<!--
Now, since all three levels want to be able to monitor the network for their own devious purposes, all three need to have net access.  The external network is connected directly into the internet, so we don't have to mess with proxy servers here.  The Mercenary and Troop networks are behind firewalls, so it is necessary to set up proxy servers here.
-->
さて、 3つ全てのレベルがその独自の邪な目的の為にネットワーク上の
情報を傍受できるようにしたいので、 3つ全てでネットワークにアクセスできる
必要があります。
external ネットワークは直接インターネットに接続されるので、この界面に
プロキシサーバを置いてはなりません。
Mercenary と Troop のネットワークはファイアウォールの後ろにあるので、
ここにプロキシサーバを設定する必要があります。

<!--
Both networks will be setup very similarly.  They both have the same IP addresses assigned to them.  I will throw in a couple of parameters, just to make things more interesting though.
-->
両方のネットワークは非常に似た設定になります。両方のネットワークは同じ
IP アドレスが割り当てられます。
もっと興味深いものにする為に、いくつかの要素を加えてみたいと思います。

<!--TODO so its off limits は so it's off limits の typo? -->
<!--
<enum>
<item>No one can use the file server for internet access.  This exposes the file server to viruses and other nasty things, and it is rather important, so its off limits.

<item>We will not allow troop access to the World Wide Web.  They are in training, and this kind of information retrieval power might prove to be damaging.
</enum>
-->
<enum>
<item>誰もファイルサーバをインターネットアクセス用に使ってはなりません。
ファイルサーバがウィルスや他の意地悪なことにさらされることは、かなり
重要なことなので、立ち入り禁止です。

<item>troop ネットワークからワールドワイドウェブにアクセスすることは
許しません。
彼らは訓練中であり、この種の外部の情報の検索を許すことは結果として
有害な結果に終わることがままあるものです。
</enum>

<!--
So, the sockd.conf file on the Troop's Linux box will have this line:
-->
だから、Troop の Linux box 上の sockd.conf ファイルには次の行があります。

<verb>
    deny 192.168.1.17 255.255.255.255
</verb>

<!--
and on the Mercenary machine:
-->
そして、Mercenary のマシンには -

<verb>
    deny 192.168.1.23 255.255.255.255
</verb>

<!--
And, the Troop's Linux box will have this line
-->
があります。また、Troop の Linux box には次の行があり -

<verb>
    deny 0.0.0.0 0.0.0.0 eq 80
</verb>

<!--
This says to deny access to all machines trying to access the port equal (eq) to 80, the http port.  This will still allow all other services, just deny Web access.
-->
80 に等しい (eq) ポート (http のポート) にアクセスを試みる全てのマシン
を拒否 (deny) します。
他の全てのサービスをまだ許しています。ウェブアクセスのみ拒否しています。

<!--
Then, both files will have:
-->
次に、両方のマシンのファイルには -

<verb>
    permit 192.168.1.0 255.255.255.0
</verb>

<!--
to allow all the computers on the 192.168.1.xxx network to use this proxy server except for those that have already been denied (ie. The file server and Web access from the Troop network).
-->
があり、192.168.1.xxx のネットワーク上の全てのコンピュータが、既に
拒否したこと (すなわち Troop ネットワークからのファイルサーバと
ウェブへのアクセス) を除き、このプロキシサーバを使うことを許します。

<p>
<!--
The Troop's sockd.conf file will look like:
-->
Troop の方の sockd.conf ファイルは次のようになります - 

<verb>
    deny 192.168.1.17 255.255.255.255
    deny 0.0.0.0 0.0.0.0 eq 80
    permit 192.168.1.0 255.255.255.0
</verb>

<!--
and the Mercenary file will look like:
-->
そして Mercenary の方のファイルは次のようになります - 

<verb>
    deny 192.168.1.23 255.255.255.255
    permit 192.168.1.0 255.255.255.0
</verb>

<!--
This should configure everything correctly.  Each network is isolated accordingly, with the proper amount of interaction.  Everyone should be happy.  
-->
全ての事柄を正しく設定したはずです。
各ネットワークは適切に、程良い交流を保って分離されます。

<!-- (13) -->
<!--
<sect> Making Management Easy
-->
<sect> 簡単な管理の為に

<p>
<!--
<sect1> Firewall tools
-->
<sect1> ファイアウォールツール

<p>
<!--
There are several software packages that will make managing your firewall easier.
-->
ファイアウォールを簡単に管理するためのソフトウェアパッケージがいくつか
あります。

<!--TODO wright は right の typo? -->
<!--
Be carefull, don't use these tools unless you can do without them.  These scripts make it just as easy to make a misstake as they do to help you get it wright.
-->
これらのツールなしで管理する能力がなければ、これらは使えないことに
注意してください。
これらのスクリプトは管理を正しく行うことに役立ちますが、
同様に間違った管理も簡単に行わせてくれます。

<!--
Both graphical and web based interfaces are being developed to work with the Linux filtering rules.  Some companies have even create commercial firewalls based on Linux by putting it in their own box with their own management code. (nice)
-->
Linux のフィルタルールと動作させる為に、グラフィカルなウェブベースの
インターフェースを開発しています。
更に数社は Linux を基にその box 内に独自の管理プログラムを置くことにより
商用ファイアウォールを作成しています。
(素晴らしい)

<!--
I'm not realy a GUI guy.  However, I have been using firewalls with GUI interfaces for some time. I've found they help by providing a nice report of all the rules in one easy glance.
-->
私は実のところ GUI 野郎ではありません。しかし、ある期間、
ファイアウォールの GUI インターフェースを使ったことがあります。
一目で全てのルールを見ることの出来る素晴らしいレポートを提供する
機能が役立つことを知りました。

<!--
gfcc (GTK+ Firewall Control Center) is a GTK+ application which can control Linux firewall policies and rules, based on ipchains package.  Go to <url url="http://icarus.autostock.co.kr/" name="http://icarus.autostock.co.kr"> and get your copy. This is a realy good tool.
-->
gfcc (GTK+ Firewall Control Center) は GTK+ アプリケーションで、ipchains
パッケージに基づき、Linux のファイアウォールポリシーとルールを制御
できます。<url url="http://icarus.autostock.co.kr/"
name="http://icarus.autostock.co.kr"> を訪れ、ダウンロードしてください。
これは本当にいいツールです。

<!--
I have included RC scripts in appendex A. These scripts work with and without gfcc.
-->
appendex A に RC スクリプトを載せました。
これらのスクリプトは gfcc があってもなくても動作します。

<!--TODO Another will done は Another well done の typo? -->
<!--
There a lots of scripts avaible to setup a firewall. One very complete script is avaible at <url url="http://www.jasmine.org.uk/~simon/bookshelf/papers/instant-firewall/instant-firewall.html" name="http://www.jasmine.org.uk/~simon/bookshelf/papers/instant-firewall/instant-firewall.html">. Another will done script is at <url url="http://www.pointman.org/" name="http://www.pointman.org/">. 
-->
ファイアウォールの設定に利用可能なスクリプトがたくさんあります。
一つは非常に完全なスクリプトで 
<url url="http://www.jasmine.org.uk/~simon/bookshelf/papers/instant-firewall/instant-firewall.html" name="http://www.jasmine.org.uk/~simon/bookshelf/papers/instant-firewall/instant-firewall.html">
から入手できます。
もう一つはよくできたスクリプトで 
<url url="http://www.pointman.org/" name="http://www.pointman.org/"> から
入手できます。

<!--
Kfirewall is a GUI frontend for ipchains or ipfwadm (depending on your kernel version). 
<url url="http://megaman.ypsilonia.net/kfirewall/" name="http://megaman.ypsilonia.net/kfirewall/">
-->
Kfirewall は ipchains か ipfwadm (使用するカーネルバージョンに依存します)
用の GUI フロントエンドです。
<url url="http://megaman.ypsilonia.net/kfirewall/" 
name="http://megaman.ypsilonia.net/kfirewall/">

<!--
FCT is an HTML based tool for the configuration of a firewall. It features automatic script-generation for IP-filtering commands (ipfwadm) on a firewall for multiple interfaces and any internet services. 
<url url="http://www.fen.baynet.de/~ft114/FCT/firewall.htm" name="http://www.fen.baynet.de/~ft114/FCT/firewall.htm">
-->
FCT はファイアウォールの設定用 HTML ベースのツールです。
複数のインターフェースといくつかのインターネットサービス用の
ファイアウォール上で、IP フィルタコマンド (ipfwadm) のスクリプトを
自動生成する特徴があります。
<url url="http://www.fen.baynet.de/~ft114/FCT/firewall.htm"
name="http://www.fen.baynet.de/~ft114/FCT/firewall.htm">

<!--
<sect1> General tools
-->
<sect1> 汎用ツール

<p>
<!--
WebMin is a general system admin package. It will not help you manage the firewall rules but it will help you with turning on and off damons and processes.  This program is VERY good, I'm hoping the J. Cameron will include a IPCHAINS module. <url URL="http://www.webmin.com/" name="http://www.webmin.com/">
-->
WebMin は汎用的なシステム管理パッケージです。ファイアウォールルールの
管理には役立たないでしょうが、デーモンとプロセスの起動と停止には
役立つでしょう。
このプログラムはとてもいいのですが、J. Cameron が IPCHAINS の
モジュールを入れてくれることを望んでいます。
<url URL="http://www.webmin.com/" name="http://www.webmin.com/">

<!--
If you are an ISP, you will want to know about IPFA (IP Firewall Acounting) <url url="http://www.soaring-bird.com/ipfa/" name="http://www.soaring-bird.com/ipfa/">. It can do Per-Month/Per-day/per-min/ logs and has a Web based GUI administation.
-->
ISP の方なら、IPFA (IP Firewall Acounting) 
<url url="http://www.soaring-bird.com/ipfa/"
name="http://www.soaring-bird.com/ipfa/"> 
について知りたいでしょう。
月毎/日毎/分毎の記録が取れ、ウェブベースの GUI 管理メニューがあります。

<!-- (14) -->
<!--TODO p tag が抜けてい?-->
<!--
<SECT> Defeating a Proxy Firewall
Just to spoil your day, and keep you on your toes about security, I'll describe how easy it is to defeat a proxy firewall.
-->
<SECT> プロキシファイアウォールをだめにする
<p>
あなたの人生を台無しにしてあなたにセキュリティについて関心を持ち続けて
いただく為に、プロキシファイアウォールをだめにすることがどんなに
簡単かを説明します。

<!--
Now that you have done everything in this document and have a very secure server and network.  You have a DMZ and no one can get into your network and you are logging every connection made to the outside world. You make all your users go through a proxy and no one can go directly to the Internet.
-->
この文書に書いてある全ての処置をしたので、非常に安全なサーバと
ネットワークになっています。
DMZ があり、ネットワークには誰も入りこめず、外部ネットワークへの接続は
全て記録されるような完璧なネットワークです。
ユーザはインターネットに接続するのにプロキシを経由します。
直接インターネットに接続できるユーザはいません。

<!--
Then one of your users, with a didacated connection of his own, finds out about <url url="http://www.nocrew.org/software/httptunnel.html" name="httptunnel">. httptunnel creates a bidirectional virtual data path tunnelled in HTTP requests. The HTTP requests can be sent via an HTTP proxy if so desired. 
-->
その後、一人のユーザが、自分専用のコネクションの為に、<url
url="http://www.nocrew.org/software/httptunnel.html" name="httptunnel">
の存在に気づきました。
httptunnel は HTTP のリクエストでトンネリングされた双方向の仮想的な
(HTTP 以外のプロトコルを通せる) データパスを作ります。
HTTP リクエストを送りたいなら、HTTP プロキシ経由でできます。

<!--
Or, on their system  they install a Virtual Private Network (vpn). See: <url url="http://sunsite.auc.dk/vpnd/" name="http://sunsite.auc.dk/vpnd/">
-->
もしくは、ユーザ自身のシステムに Virtual Private Network (vpn) を
インストールします。
<url url="http://sunsite.auc.dk/vpnd/"
name="http://sunsite.auc.dk/vpnd/">
を参照のこと。

<!--
Or, Maybe this user simply puts a modem on their NT system and turns on routing.
-->
もしくは、単純に、ユーザ自身の NT システムにモデムを繋ぎ、
ルーティングをオンにしてしまうかもしれません。

<!--
Finally, on the workstation, on the private LAN, change the default gateway to point to the new route to the Internet. 
-->
最後に、プライベート LAN 上のワークステーション上で、インターネットへの
新しい経路を指すようデフォルトゲートウェイを変更します。

<!--TODO draft1 では nowill が no one の typo だとしても意味が取れなかっ
た-->
<!--
Now, from this workstation, you can go anywhere. The only thing the firewall admin might see is one connect with nowill see is a really long DNS lookup.
-->
そうなった時、このワークステーションからどこへでも行くことができます。ファ
イアウォール管理者が目にする唯一の物は、実に長々と続く DNS ルックアップ
の接続だけかもしれません。

<!--
Now, take over the world!
-->
世界征服の時です!

<!-- (15) -->
<!--
<SECT> APPENDEX A - Example Scripts
-->
<SECT> APPENDEX A - スクリプトの例
<p>

<!--
<SECT1> RC Script useing GFCC
-->
<SECT1> GFCC を用いた RC スクリプト
<P>
<!--
<verb>
#!/bin/bash
#
# Firewall Script - Version 0.9.1
#
# chkconfig: 2345 09 99
# description: firewall script for 2.2.x kernel
# Set for testing
# set -x
#
# NOTES:
#
#  This script is written for RedHat 6.1 or better.
#
#  Be careful about offering public services like web or ftp servers.
#
# INSTALLATION:
#  1. place this file in /etc/rc.d/init.d  (you'll have to be root..)
#     call it something like "firewall"    :-)
#     make it root owned -&#045;>  "chown root.root (filename)"
#     make it executable -&#045;>  "chmod 755 (filename)"
#
#  2. use GFCC to create your firewall rules and export them to a file
#     named /etc/gfcc/rules/firewall.rule.sh.
#
#  3. add the firewall to the RH init structure -&#045;> "chkconfig -&#045;add (filename)"
#     next time the router boots, things should happen automagically!
#     sleep better at night knowing you are *LESS* vulnerable than before...
#
# RELEASE NOTES
#   30 Jan, 2000 - Changed to GFCC script 
#   11 Dec, 1999 - updated by Mark Grennan &lt;mark@grennan.com&gt;
#   20 July, 1999 - initial writing - Anthony Ball &lt;tony@LinuxSIG.org&gt;
#

################################################

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we are called
case "$1" in

  start)
	# Start providing access
	action "Starting firewall: " /bin/true
	/etc/gfcc/rules/firewall.rule.sh
	action "Loading firewall modules: " /bin/true
#       /sbin/insmod ip_masq_autofw
#       /sbin/insmod ip_masq_suseeme
        /sbin/insmod ip_masq_ftp
        /sbin/insmod ip_masq_irc
#       /sbin/insmod ip_masq_mfw
#       /sbin/insmod ip_masq_portfw
#       /sbin/insmod ip_masq_quake
        /sbin/insmod ip_masq_raudio
#       /sbin/insmod ip_masq_user
#       /sbin/insmod ip_masq_vdolive
	echo
	;;

  stop)
	action "Stoping firewall: " /bin/true
	echo 0 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	echo
	;;

  restart)
	action "Restarting firewall: " /bin/true
	$0 stop
	$0 start

	echo
	;;

  status)
	# List out all settings
	/sbin/ipchains -L
	;;

  test)
	action "Test Mode firewall: " /bin/true
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward
	echo 1 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -A input -j ACCEPT
	/sbin/ipchains -A output -j ACCEPT
	/sbin/ipchains -P forward DENY
	/sbin/ipchains -A forward -i $PUBLIC -j MASQ

	echo
	;;

  *)
	echo "Usage: $0 {start|stop|restart|status|test}"
	exit 1

esac
</verb>
 -->
<verb>
#!/bin/bash
#
# Firewall Script - Version 0.9.1
#
# chkconfig: 2345 09 99
# 概要: 2.2.x カーネル用ファイアウォールスクリプト
# テストの際には
# -x を追加すること。
#
# 注意 - 
#
# このスクリプトは RedHat 6.0 及びそれ以降のバージョン向けに書かれて
# います。
#
# ウェブや ftp サーバのような公開サービスを提供する場合は注意して
# ください。
#
# インストール - 
#  1. /etc/rc.d/init.d の中にこのファイルを置きます。
#     (root にならなければならないでしょう...)
#     "firewall" のような名前にします    :-)
#     所有権を root にします -->  "chown root.root (ファイル名)"
#     実行属性を立てます     -->  "chmod 755 (ファイル名)"
#
#  2. ファイアウォールルールを作る為に GFCC を使い、
#     ファイル /etc/gfcc/rules/firewall.rule.sh に書き写します。
#
#  3. RedHat の init スクリプトにファイアウォールを
#     追加します --> "chkconfig --add (ファイル名)"
#     次回ルータを起動すると firewall サービスが自動的に起動するはずです!
#     *前より少しは* 脆弱でなくなっているので、夜はぐっすり寝てください。
#
# リリースノート
#   30 Jan, 2000 - GFCC スクリプトに変更
#   11 Dec, 1999 - Mark Grennan &lt;mark@grennan.com&gt; による更新
#   20 July, 1999 - 最初の作品 - Anthony Ball &lt;tony@LinuxSIG.org&gt;
#

################################################

# 関数ライブラリを読み込みます。
. /etc/rc.d/init.d/functions

# ネットワーク設定を読み込みます。
. /etc/sysconfig/network

# ネットワークが起動しているかチェックします。
[ ${NETWORKING} = "no" ] && exit 0

# 何が呼び出されたかを見ます。
case "$1" in

  start)
	# アクセス機能の提供を開始します。
	action "Starting firewall: " /bin/true
	/etc/gfcc/rules/firewall.rule.sh
	action "Loading firewall modules: " /bin/true
#       /sbin/insmod ip_masq_autofw
#       /sbin/insmod ip_masq_suseeme
        /sbin/insmod ip_masq_ftp
        /sbin/insmod ip_masq_irc
#       /sbin/insmod ip_masq_mfw
#       /sbin/insmod ip_masq_portfw
#       /sbin/insmod ip_masq_quake
        /sbin/insmod ip_masq_raudio
#       /sbin/insmod ip_masq_user
#       /sbin/insmod ip_masq_vdolive
	echo
	;;

  stop)
	action "Stoping firewall: " /bin/true
	echo 0 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	echo
	;;

  restart)
	action "Restarting firewall: " /bin/true
	$0 stop
	$0 start

	echo
	;;

  status)
	# 設定内容をリスト表示します。
	/sbin/ipchains -L
	;;

  test)
	action "Test Mode firewall: " /bin/true
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward
	echo 1 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -A input -j ACCEPT
	/sbin/ipchains -A output -j ACCEPT
	/sbin/ipchains -P forward DENY
	/sbin/ipchains -A forward -i $PUBLIC -j MASQ

	echo
	;;

  *)
	echo "Usage: $0 {start|stop|restart|status|test}"
	exit 1

esac
</verb>
<P>

<!--
<SECT1> GFCC script
-->
<SECT1> GFCC スクリプト
<p>
<!--
This script was generated by the Graphical Firewall program (GFCC).  This is not the working rule set. This is the exported rules set.
-->
このスクリプトは Graphical Firewall program (GFCC) によって
生成されました。
これは動作するルールセットではありません。
転写されたルールセットです。

<!-- 
<verb>

#!/bin/sh
# Generated by Gtk+ firewall control center

IPCHAINS=/sbin/ipchains


localnet="192.168.1.0/24"
firewallhost="192.168.1.1/32"
localhost="172.0.0.0/8"
DNS1="24.94.163.119/32"
DNS2="24.94.163.124/32"
Broadcast="255.255.255.255/32"
Multicast="224.0.0.0/8"
Any="0.0.0.0/0"
mail_grennan_com="192.168.1.1/32"
mark_grennan_com="192.168.1.3/32"

$IPCHAINS -P input DENY
$IPCHAINS -P forward ACCEPT
$IPCHAINS -P output ACCEPT

$IPCHAINS -F
$IPCHAINS -X

# input rules
$IPCHAINS -A input -s $Any -d $Broadcast -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any netbios-ns -j DENY 
$IPCHAINS -A input -p tcp -s $Any -d $Any netbios-ns -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any netbios-dgm -j DENY 
$IPCHAINS -A input -p tcp -s $Any -d $Any netbios-dgm -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any bootps -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any bootpc -j DENY 
$IPCHAINS -A input -s $Multicast -d $Any -j DENY 
$IPCHAINS -A input -s $localhost -d $Any -i lo -j ACCEPT 
$IPCHAINS -A input -s $localnet -d $Any -i eth1 -j ACCEPT 
$IPCHAINS -A input -s $localnet -d $Broadcast -i eth1 -j ACCEPT 
$IPCHAINS -A input -p icmp -s $Any -d $Any -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any -j ACCEPT ! -y 
$IPCHAINS -A input -p udp -s $DNS1 domain -d $Any 1023:65535 -j ACCEPT 
$IPCHAINS -A input -p udp -s $DNS2 domain -d $Any 1023:65535 -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any ssh -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any telnet -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any smtp -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any pop-3 -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any auth -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any www -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any ftp -j ACCEPT 
$IPCHAINS -A input -s $Any -d $Any -j DENY -l 

# forward rules
$IPCHAINS -A forward -s $localnet -d $Any -j MASQ 

# output rules

</verb>
-->
<verb>

#!/bin/sh
# Gtk+ ファイアウォールコントロールセンターが生成しました。

IPCHAINS=/sbin/ipchains


localnet="192.168.1.0/24"
firewallhost="192.168.1.1/32"
localhost="172.0.0.0/8"
DNS1="24.94.163.119/32"
DNS2="24.94.163.124/32"
Broadcast="255.255.255.255/32"
Multicast="224.0.0.0/8"
Any="0.0.0.0/0"
mail_grennan_com="192.168.1.1/32"
mark_grennan_com="192.168.1.3/32"

$IPCHAINS -P input DENY
$IPCHAINS -P forward ACCEPT
$IPCHAINS -P output ACCEPT

$IPCHAINS -F
$IPCHAINS -X

# input ルール
$IPCHAINS -A input -s $Any -d $Broadcast -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any netbios-ns -j DENY 
$IPCHAINS -A input -p tcp -s $Any -d $Any netbios-ns -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any netbios-dgm -j DENY 
$IPCHAINS -A input -p tcp -s $Any -d $Any netbios-dgm -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any bootps -j DENY 
$IPCHAINS -A input -p udp -s $Any -d $Any bootpc -j DENY 
$IPCHAINS -A input -s $Multicast -d $Any -j DENY 
$IPCHAINS -A input -s $localhost -d $Any -i lo -j ACCEPT 
$IPCHAINS -A input -s $localnet -d $Any -i eth1 -j ACCEPT 
$IPCHAINS -A input -s $localnet -d $Broadcast -i eth1 -j ACCEPT 
$IPCHAINS -A input -p icmp -s $Any -d $Any -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any -j ACCEPT ! -y 
$IPCHAINS -A input -p udp -s $DNS1 domain -d $Any 1023:65535 -j ACCEPT 
$IPCHAINS -A input -p udp -s $DNS2 domain -d $Any 1023:65535 -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any ssh -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any telnet -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any smtp -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any pop-3 -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any auth -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any www -j ACCEPT 
$IPCHAINS -A input -p tcp -s $Any -d $Any ftp -j ACCEPT 
$IPCHAINS -A input -s $Any -d $Any -j DENY -l 

# forward ルール
$IPCHAINS -A forward -s $localnet -d $Any -j MASQ 

# output ルール

</verb>

<!--
<SECT1> RC Script without GFCC
This is the firewall rules set built my hand. It does not use GFCC.
-->
<SECT1> GFCC を使わない RC スクリプト
<p>
これは手書きで構築したファイアウォールのルールセットです。
GFCC は使いません。
<P>
<!-- 
<verb>
#!/bin/bash
#
# Firewall Script - Version 0.9.0

# chkconfig: 2345 09 99
# description: firewall script for 2.2.x kernel

# Set for testing
# set -x

#
# NOTES:
#
#  This script is written for RedHat 6.0 or better.
#
#  This firewall script should work for most routers, dial-up or cable modem.
#  It was written for RedHat distributions. 
#
#  Be careful about offering public services like web or ftp servers.
#
# INSTALLATION:
#  1. This file planned for a RedHat system.  It would work
#     on other distro's with perhaps no modification, but again...
#     Who knows?!!?  These instructions apply to RedHat systems.
#
#  2. place this file in /etc/rc.d/init.d  (you'll have to be root..)
#     call it something like "firewall"    :-)
#     make it root owned -&#045;>  "chown root.root <filename>"
#     make it executable -&#045;>  "chmod 755 <filename>"
#
#  3. set the values for your network, internal interface, and DNS servers
#     uncomment lines further down to enable optional in-bound services
#     make sure "eth0" is your internal NIC (or change the value below)
#     test it -&#045;>  "/etc/rc.d/init.d/<filename> start"
#     you can list the rules -&#045;>  "ipchains -L -n"
#     fix anything that broke...  :-)
#
#  4. add the firewall to the RH init structure -&#045;> "chkconfig -&#045;add <filename>"
#     next time the router boots, things should happen automagically!
#     sleep better at night knowing you are *LESS* vulnerable than before...
#
# RELEASE NOTES
#   20 July, 1999 - initial writing - Anthony Ball <tony@LinuxSIG.org>
#   11 Dec, 1999 - updated by Mark Grennan <mark@grennan.com>
#

################################################
#  Fill in the values below to match your
#  local network.

PRIVATENET=xxx.xxx.xxx.xxx/xx

PUBLIC=ppp0
PRIVATE=eth0

# your dns servers
DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx

################################################

# some handy generic values to use
ANY=0.0.0.0/0
ALLONES=255.255.255.255

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we are called
case "$1" in

  start)
	# Start providing access
	action "Starting firewall: " /bin/true

	##
	## Setup Envirement
	##
	# Flush all lists
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	# Plug up everything
	/sbin/ipchains -I input 1 -j DENY

	# set policy to deny (Default is ACCEPT)
	/sbin/ipchains -P input DENY
	/sbin/ipchains -P output ACCEPT
	/sbin/ipchains -P forward ACCEPT

	# Turn on packet forwarding
	echo 1 > /proc/sys/net/ipv4/ip_forward

	##
	## Install Modules 
	##
	# Insert the active ftp module.  This will allow non-passive ftp to machines
	# on the local network (but not to the router since it is not masq'd)
	if ! ( /sbin/lsmod | /bin/grep masq_ftp > /dev/null ); then
	    /sbin/insmod ip_masq_ftp
	fi

	##
	## Some Security Stuff
	##
	# turn on Source Address Verification and get spoof protection
	# on all current and future interfaces.
	if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
	    for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
	        echo 1 > $f
	    done
	else
	    echo
	    echo "PROBLEMS SETTING UP IP SPOOFING PROTECTION.  BE WORRIED."
	    echo
	fi

	# deny bcasts on remaining interfaces
	/sbin/ipchains -A input -d 0.0.0.0 -j DENY
	/sbin/ipchains -A input -d 255.255.255.255 -j DENY

	# deny these without logging 'cause there tend to be a lot...
	/sbin/ipchains -A input -p udp -d $ANY 137 -j DENY   # NetBIOS over IP
	/sbin/ipchains -A input -p tcp -d $ANY 137 -j DENY   #   ""
	/sbin/ipchains -A input -p udp -d $ANY 138 -j DENY   #   ""
	/sbin/ipchains -A input -p tcp -d $ANY 138 -j DENY   #   ""
	/sbin/ipchains -A input -p udp -d $ANY 67 -j DENY    # bootp
	/sbin/ipchains -A input -p udp -d $ANY 68 -j DENY    #   ""
	/sbin/ipchains -A input -s 224.0.0.0/8 -j DENY       # Multicast addresses

	##
	## Allow private network out
	##
	# allow all packets on the loopback interface
	/sbin/ipchains -A input -i lo -j ACCEPT

	# allow all packets from the internal "trusted" interface
	/sbin/ipchains -A input -i $PRIVATE -s $PRIVATENET -d $ANY -j ACCEPT
	/sbin/ipchains -A input -i $PRIVATE -d $ALLONES -j ACCEPT

	## 
	## Allow Outside Services into the firewall (if you dare)
	##
	# allow ICMP
	/sbin/ipchains -A input -p icmp -j ACCEPT
	# allow TCP
	/sbin/ipchains -A input -p tcp ! -y -j ACCEPT

	# allow lookups to DNS (on firewall)
	/sbin/ipchains -A input -p udp -s $DNS1 domain -d $ANY 1023: -j ACCEPT
	/sbin/ipchains -A input -p udp -s $DNS2 domain -d $ANY 1023: -j ACCEPT
	# or (BETTER IDEA) run a caching DNS server on the router and use the 
	# following two lines instead...
	# /sbin/ipchains -A input -p udp -s $DNS1 domain -d $ANY domain -j ACCEPT
	# /sbin/ipchains -A input -p udp -s $DNS2 domain -d $ANY domain -j ACCEPT

	# uncomment the following to allow ssh in
	/sbin/ipchains -A input -p tcp -d $ANY 22 -j ACCEPT

	# uncomment the following to allow telnet in (BAD IDEA!!)
	/sbin/ipchains -A input -p tcp -d $ANY telnet -j ACCEPT

	# uncomment to allow NTP (network time protocol) to router
	# /sbin/ipchains -A input -p udp -d $ANY ntp -j ACCEPT

	# uncomment to allow SMTP in (not for mail clients - only a server)
	/sbin/ipchains -A input -p tcp -d $ANY smtp -j ACCEPT

	# uncomment to allow POP3 in (for mail clients)
	/sbin/ipchains -A input -p tcp -d $ANY 110 -j ACCEPT

	# allow auth in for sending mail or doing ftp
	/sbin/ipchains -A input -p tcp -d $ANY auth -j ACCEPT

	# uncomment to allow HTTP in (only if you run a web server on the router)
	/sbin/ipchains -A input -p tcp -d $ANY http -j ACCEPT

	# uncomment to allow FTP in
	/sbin/ipchains -A input -p tcp -d $ANY ftp -j ACCEPT

	##
	## Masquerading stuff
	##
	# masquerade packets forwarded from internal network
	/sbin/ipchains -A forward -s $PRIVATENET -d $ANY -j MASQ

	##
	## deny EVERYthing else and log them to /var/log/messages
	##
	/sbin/ipchains -A input -l -j DENY

	# Remove the Plug
	/sbin/ipchains -D input 1

	;;

  stop)
	action "Stoping firewall: " /bin/true
	echo 0 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	echo
	;;

  restart)
	action "Restarting firewall: " /bin/true
	$0 stop
	$0 start

	echo
	;;

  status)
	# List out settings
	/sbin/ipchains -L
	;;

  test)
	##
	## This is about as simple as it gets
	##    (This is not secure AT ALL)
	action "WARNING Test Firewall: " /bin/true
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward
	echo 1 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -A input -j ACCEPT
	/sbin/ipchains -A output -j ACCEPT
	/sbin/ipchains -P forward DENY
	/sbin/ipchains -A forward -i $PUBLIC -j MASQ

	echo
	;;

  *)
	echo "Usage: $0 {start|stop|restart|status|test}"
	exit 1

esac

</VERB>
 -->
<verb>
#!/bin/bash
#
# Firewall Script - Version 0.9.0

# chkconfig: 2345 09 99
# 概要: 2.2.x カーネル用ファイアウォールスクリプト

# テストの際には
# -x を追加すること。

#
# 注意 - 
#
# このスクリプトは RedHat 6.0 及びそれ以降のバージョン向けに書かれています。
#
#  このファイアウォールスクリプトは、大部分のダイアルアップかケーブルモデム
#  を使用したルータで動く筈です。
#  RedHat ディストリビューション用に作成しました。
#
#  web や ftp サーバのような公開サービスを提供する場合は注意してください。
#
# インストール -
#  1. このファイルは RedHat システム用に作られています。このままで他の
#     ディストリビューションでも動くと思いますが、もう一度確認した方が
#     いいでしょう。
#     もしかして動かないかもしれないから?!!?
#     これらの手順は RedHat システムに適用します。
#
#  2. /etc/rc.d/init.d の中にこのファイルを置きます (root になって...)
#     "firewall" のような名前にします    :-)
#     所有権を root にします -->  "chown root.root <ファイル名>"
#     実行権をつけます -->  "chmod 755 <ファイル名>"
#
#  3. ネットワーク、使用するインターフェース、DNS サーバの設定をします。
#     uncomment で始まる行の下で、受付けサービスを選択し有効にします。
#     "eth0" が使用する NIC か確認します (或はあなたのシステムのネットワーク
#     インターフェース名に変更します)。
#     テストするには -->  "/etc/rc.d/init.d/<ファイル名> start"
#     ルールを一覧するには -->  "ipchains -L -n"
#     誤りがあれば修正しましょう...  :-)
#
#  4. RedHat の init スクリプトにファイアウォールを追加します
#                                     --> "chkconfig --add <ファイル名>"
#     次回ルータを起動すると firewall サービスが自動的に起動するはずです！
#     *前より少しは* 脆弱でなくなっているので、夜はぐっすり寝てください。
#
# リリースノート
#   20 July, 1999 - 最初の作品 - Anthony Ball <tony@LinuxSIG.org>
#   11 Dec, 1999 - Mark Grennan <mark@grennan.com> による更新
#

################################################
#  あなたのローカルネットワークに適合する値を記入してください。

PRIVATENET=xxx.xxx.xxx.xxx/xx

PUBLIC=ppp0
PRIVATE=eth0

# あなたの dns サーバの設定
DNS1=xxx.xxx.xxx.xxx
DNS2=xxx.xxx.xxx.xxx

################################################
# ネットワークの設定に用いる汎用的な値を定義します。
ANY=0.0.0.0/0
ALLONES=255.255.255.255

# 関数ライブラリを読み込みます。
. /etc/rc.d/init.d/functions

# ネットワーク設定を読み込みます。
. /etc/sysconfig/network

# ネットワークが起動しているかチェックします。
[ ${NETWORKING} = "no" ] && exit 0

# 何が呼び出されたかを見ます。
case "$1" in

  start)
	# アクセス機能の提供を開始します。
	action "Starting firewall: " /bin/true

	##
	## 環境設定
	##
	# 全てのチェインのリストを全消去します。
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	# input チェインに蓋をかぶせて、全てのポートをふさぎます。
	/sbin/ipchains -I input 1 -j DENY

	# ポリシーを否定 (DENY) に設定します。 (デフォルトはACCEPT)
	/sbin/ipchains -P input DENY
	/sbin/ipchains -P output ACCEPT
	/sbin/ipchains -P forward ACCEPT

	# パケットフォワーディングを有効にします。
	echo 1 > /proc/sys/net/ipv4/ip_forward

	##
	## モジュールのインストール
	##
	# アクティブ ftp モジュールを読み込みます。
	# ローカルネットワーク上のマシンに非パッシヴ ftp アクセスが
	# できるようにします。
	# (但し、ルータ自身はマスカレードされていないので除外されます。)
	if ! ( /sbin/lsmod | /bin/grep masq_ftp > /dev/null ); then
	    /sbin/insmod ip_masq_ftp
	fi

	##
	## セキュリティ関係
	##
	# 現存するネットワークインターフェースおよび今後発生するであろう
	# ネットワークインターフェースに対し、発信アドレスの立証と偽装保護を
	# 有効にします。
	# 
	# 
	if [ -e /proc/sys/net/ipv4/conf/all/rp_filter ]; then
	    for f in /proc/sys/net/ipv4/conf/*/rp_filter; do
	        echo 1 > $f
	    done
	else
	    echo
	    echo "PROBLEMS SETTING UP IP SPOOFING PROTECTION.  BE WORRIED."
	    echo
	fi

	# 現存する全てのネットワークインターフェースのブロードキャストを
	# 否定します。
	/sbin/ipchains -A input -d 0.0.0.0 -j DENY
	/sbin/ipchains -A input -d 255.255.255.255 -j DENY

	# これらはログ記録することなく否定します。
	/sbin/ipchains -A input -p udp -d $ANY 137 -j DENY   # NetBIOS over IP
	/sbin/ipchains -A input -p tcp -d $ANY 137 -j DENY   #   ""
	/sbin/ipchains -A input -p udp -d $ANY 138 -j DENY   #   ""
	/sbin/ipchains -A input -p tcp -d $ANY 138 -j DENY   #   ""
	/sbin/ipchains -A input -p udp -d $ANY 67 -j DENY    # bootp
	/sbin/ipchains -A input -p udp -d $ANY 68 -j DENY    #   ""
	/sbin/ipchains -A input -s 224.0.0.0/8 -j DENY       # Multicast addresses

	##
	## プライベートネットワークから発するパケットを許可します。
	##
	# ループバックインターフェース上の全てのパケットを許可します。
	/sbin/ipchains -A input -i lo -j ACCEPT

	# 内部の "信頼できる" インターフェースから発せられるパケットを全て
	# 許可します。
	/sbin/ipchains -A input -i $PRIVATE -s $PRIVATENET -d $ANY -j ACCEPT
	/sbin/ipchains -A input -i $PRIVATE -d $ALLONES -j ACCEPT

	## 
	## ファイアウォールへの外部サービスを許可します。
	##
	# ICMP を許可します。
	/sbin/ipchains -A input -p icmp -j ACCEPT
	# TCP を許可します。
	# 【訳注: tcp syn パケット以外を許可します。】
	/sbin/ipchains -A input -p tcp ! -y -j ACCEPT

	# (ファイアウォール上の)DNS探索を許可します。
	/sbin/ipchains -A input -p udp -s $DNS1 domain -d $ANY 1023: -j ACCEPT
	/sbin/ipchains -A input -p udp -s $DNS2 domain -d $ANY 1023: -j ACCEPT
	# あるいは (より良い案として) キャッシュ DNS サーバをルータ上で
	# 稼動させ、上記の代わりに以下の行を用います。
	# /sbin/ipchains -A input -p udp -s $DNS1 domain -d $ANY domain -j ACCEPT
	# /sbin/ipchains -A input -p udp -s $DNS2 domain -d $ANY domain -j ACCEPT

	# 以下の行で ssh を許可します。
	/sbin/ipchains -A input -p tcp -d $ANY 22 -j ACCEPT

	# 以下の行で telnet を許可します。 (お薦めしません!!)
	/sbin/ipchains -A input -p tcp -d $ANY telnet -j ACCEPT

	# 以下の行でルータに NTP (network time protocol: ネットワーク
	# タイムプロトコル) を許可します。
	# /sbin/ipchains -A input -p udp -d $ANY ntp -j ACCEPT

	# SMTP を許可します。 (メールクライアントの為ではありません - サーバ
	# だけです)
	/sbin/ipchains -A input -p tcp -d $ANY smtp -j ACCEPT

	# POP3 を許可します。(メールクライアント用)
	/sbin/ipchains -A input -p tcp -d $ANY 110 -j ACCEPT

	# メール送信または ftp アクセスに用いる auth プロトコルを
	# 許可します。
	/sbin/ipchains -A input -p tcp -d $ANY auth -j ACCEPT

	# 外部からの HTTP アクセスを許可します。
	# (ルータ上で web サーバを稼働している場合に限ります。)
	/sbin/ipchains -A input -p tcp -d $ANY http -j ACCEPT

	# 外部からの FTP アクセスを許可します。
	/sbin/ipchains -A input -p tcp -d $ANY ftp -j ACCEPT

	##
	## マスカレード関係
	##
	# 内部ネットワークから転送されたパケットをマスカレードします。
	/sbin/ipchains -A forward -s $PRIVATENET -d $ANY -j MASQ

	##
	## 上記以外の全てを拒否し、 /var/log/messages へログ記録します。
	##
	/sbin/ipchains -A input -l -j DENY

	# input チェインにかぶせていた蓋を取り外します。
	/sbin/ipchains -D input 1

	;;

  stop)
	action "Stoping firewall: " /bin/true
	echo 0 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward

	echo
	;;

  restart)
	action "Restarting firewall: " /bin/true
	$0 stop
	$0 start

	echo
	;;

  status)
	# 設定内容をリスト表示します。
	/sbin/ipchains -L
	;;

  test)
	##
	## とても単純なファイアウォールのテストです。
	## (*全く*セキュアではありません)
	## 【訳注: パケットフィルタリングの設定を全て取り払い、
	## マスカレードの設定のみ有効にします。
	## この設定は長時間続けてはなりません。】
	action "WARNING Test Firewall: " /bin/true
	/sbin/ipchains -F input
	/sbin/ipchains -F output
	/sbin/ipchains -F forward
	echo 1 > /proc/sys/net/ipv4/ip_forward
	/sbin/ipchains -A input -j ACCEPT
	/sbin/ipchains -A output -j ACCEPT
	/sbin/ipchains -P forward DENY
	/sbin/ipchains -A forward -i $PUBLIC -j MASQ

	echo
	;;

  *)
	echo "Usage: $0 {start|stop|restart|status|test}"
	exit 1

esac

</VERB>


<!-- (16) -->
<!--
<SECT> APPENDEX B - An VPN RC Script for RedHat
-->
<sect> APPENDEX B - RedHat 用 VPN RC スクリプト
<p>

<!--
<VERB>
#!/bin/sh
#
# vpnd            This shell script takes care of starting and stopping
#                 vpnd (Vertual Privage Network connections).
#
# chkconfig: - 96 96
# description: vpnd 
#

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/vpnd ] || exit 0

[ -f /etc/vpnd.conf ] || exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting vpnd: "
        daemon vpnd
	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/vpnd
	echo
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down vpnd: "
        killproc vpnd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vpnd
        echo
        ;;
  restart)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: vpnd {start|stop|restart}"
        exit 1
esac

exit $RETVAL

</VERB>
-->
<VERB>
#!/bin/sh
#
# vpnd            本シェルスクリプトは vpnd (Vertual Privage Network
#                 connections / 仮想プライベートネットワーク接続) の
#                 起動と停止を引き受けます。
#
# chkconfig: - 96 96
# 概要: vpnd 
#

# 関数ライブラリを読み込みます。
. /etc/rc.d/init.d/functions

# ネットワーク設定を読み込みます。
. /etc/sysconfig/network

# ネットワークが起動しているかチェックします。
[ ${NETWORKING} = "no" ] && exit 0

[ -f /usr/sbin/vpnd ] || exit 0

[ -f /etc/vpnd.conf ] || exit 0

RETVAL=0

# 何が呼び出されたかを見ます。
case "$1" in
  start)
        # デーモンの起動。
        echo -n "Starting vpnd: "
        daemon vpnd
	RETVAL=$?
 	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/vpnd
	echo
        ;;
  stop)
        # デーモンの停止。
        echo -n "Shutting down vpnd: "
        killproc vpnd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/vpnd
        echo
        ;;
  restart)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: vpnd {start|stop|restart}"
        exit 1
esac

exit $RETVAL

</VERB>

<sect> 日本語訳について
<p>
この文書は Firewalling and Proxy Server HOWTO v0.83, August 21, 2000 版の日本語訳です。 
<p>
v0.4, 8 November 1996 は、こじまみつひろさん &lt;isle@st.rim.or.jp&gt; が日本語に翻訳しました。(1997/03/26)
<p>
Firewalling and Proxy Server HOWTO v0.83, August 21, 2000 版
<newline>
日本語訳: 2001年 9月 22日
<newline>
JF Project 「チーム Firewall」 翻訳者一覧(敬称略):
<itemize>
<item>1章  皆川哲朗 &lt;jn7vvc@hkg.odn.ne.jp&gt; 松田陽一 &lt;matsuda@palnet.or.jp&gt;
<item>2章から4章    松田陽一 &lt;matsuda@palnet.or.jp&gt;
<item>5章から11章   中谷千絵 &lt;jeanne@mbox.kyoto-inet.or.jp&gt; 
<item>12章から16章  野本浩一 &lt;hng@ps.ksky.ne.jp&gt;  
</itemize>
<p>
この文書を翻訳するにあたり、以下の方々からアドバイスをいただきました。(50音順)
<newline>
本当にありがとうございました。

<p>1章から4章
<itemize>
<item>MATSUDA Yoh-ichi さん &lt;matsuda@palnet.or.jp&gt;
<item>MIZUHARA Bun さん &lt;mizuhara@acm.org&gt;
<item>NAKANO Takeo さん &lt;nakano@apm.seikei.ac.jp&gt;
<item>TAKEI Nobumitsu さん &lt;takei@webmasters.gr.jp&gt;
<item>OBATA Noboru さん &lt;obata-ml@bk.iij4u.or.jp&gt;
</itemize>

<p>5章から11章
<itemize>
<item>NAKANO Takeo さん &lt;nakano@apm.seikei.ac.jp&gt;
<item>TAKEI Nobumitsu さん &lt;takei@webmasters.gr.jp&gt;
<item>HAYAKAWA Hitoshi さん &lt;uv9h-hykw@asahi-net.or.jp&gt;
<item>Seiji Kaneko さん &lt;se-kane@str.hitachi.co.jp&gt;
<item>kanjikanji さん &lt;kanjikanji@club-internet.fr&gt;
</itemize>

<p>12章から16章
<itemize>
<item>山田慎也さん &lt;trueheart@anet.ne.jp&gt;
<item>Seiji Kanekoさん &lt;skaneko@a2.mbn.or.jp&gt;
<item>Hiro YAMAZAKIさん &lt;hiro@linux.or.jp&gt;
<item>Konkitiさん &lt;konkiti@lares.dti.ne.jp&gt;
<item>佐野武俊さん &lt;kgh12351@nifty.ne.jp&gt;
<item>Masaharu Goto さん  &lt;magotou@fubyshare.gr.jp&gt;
<item>Keitaro Yosimura さん &lt;ramsy@linux.or.jp&gt;
<item>Tsutomu Kawashima さん &lt;kawawa@mail.interq.or.jp&gt;
<item>NAKANO Takeo さん &lt;nakano@apm.seikei.ac.jp&gt;
</itemize>

</article>

