iptablesの設定(ファイアウォール)


iptables で、パケットフィルタが行えるようです。
Kernel2.4からは、iptablesが標準の様です。
(Kernel2.2でのipchainsでも可能ですが制限があるようです)

下記コマンドが iptables コマンドの書式です。
# iptables [ -t table ] [ -A chain ] [ 条件 ] [ アクション ]

chain 指定できる chain の種類は以下の通りです。

    * PREROUTING
    * FORWARD
    * POSTROUTING
    * INPUT
    * OUTPUT
私が、試したところ小文字で入力するとだめでした。


ルールのクリアは、
            # iptables -F
で、行えるようです。

基本の設定は、
            # iptables -P INPUT ACCEPT
            # iptables -P FORWARD DROP
            # iptables -P OUTPUT ACCEPT
の様にするようです。
これで、INPUT()とOUTPUT()は、許可。FORWARD()は、拒否になるようです。

また、FTPを使用できようにするには、
ipchainと同様にモジュールをロードする必要があるようです。
modprobe ip_nat_ftp
modprobe ip_conntrack
modprobe ip_conntrack_ftp


参考にしたページ

http://penguin.nakayosi.jp/linux/iptables.html
http://www.miloweb.net/iptables.html
http://tlec.linux.or.jp/docs/iptables.html
http://www.geocities.co.jp/SiliconValley-Bay/4893/adsl.html
http://www.astec.co.jp/products/ASTECX/FAQ/iptables.html
http://www.futurewave.co.jp/linux/router.html
http://hp.vector.co.jp/authors/VA033454/linux_firewall.html
http://www.jp.redhat.com/manual/Doc9/rhl-rg-ja-9/s1-iptables-options.html
http://www.matsusaka-u.ac.jp/~okada/linux/iptables.html
http://www.geocities.co.jp/SiliconValley-Bay/4893/adsl.html
http://www.geocities.co.jp/SiliconValley-Cupertino/9120/firewall.html
http://www.earthdragon.jp/linux/iptables.html


LINUX ソフト開発塾 前のページへ戻る
--- KONDO-NET.GR.JP ---
今日のアクセス人目