[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[plamo:24272] Re: Q again for IP_MASCUERADE
-
From:tanimura
-
Date:Sat, 11 Dec 2004 10:46:57 +0900 (JST)
- Subject: [plamo:24272] Re: Q again for IP_MASCUERADE
- From: tanimura <tanimura@xxxxxxxxxxxxx>
- Date: Sat, 11 Dec 2004 10:38:37 +0900
- User-agent: Mozilla/5.0 (Windows; U; Win98; ja-JP; rv:1.4) Gecko/20030624 Netscape/7.1 (ax)
おはようございます、oJIN です。
早間義博 さん、詳細な解説付きのお応えを有難う御座います。
この様な手引きを頂くと、help や HowTo をあわせ読む勇気が出てきます。
現在は nfs, samba の基礎的な使い方をしている程度ですが、
頂いた助言を参考にしながら、一項目ずつ試みてみます。
# 剥き身の貝は好物ですが...自分が食べられてはかないません...:-)
本当に有難うございました。
> おはようございます、早間です。
>
> PREROUTING は たとえば Web サーバを ppp 接続をしていないホストで
> 稼働する場合
> iptables -t nat -A PREROUTING -p tcp -i ppp0 \
> --destination-port 81 -j DNAT \
> --to-destination 192.168.300.11:80
> のようにすると外部からのアクセスを希望するホストに誘導出来ます。
>
> ssh などで Local な IP のホストにアクセスするときに適当な port
> へのアクセスを Local IP の port 22 に PREROUTING で変更すれば
> 可能です。
> -i を使用するとネットカードを特定する事が出来ます。
> 「ローカルなホストからはアクセスを認めるが外からは認めない」などの
> 設定をするときに使用します。
>
-----------------
> pppd のオプションで defaultroute がついている場合が多いので
> default gateway が設定されていると思います。
> /etc/options か pppd のアーギュメントで指定しています。
> default gateway の現状を調べるとには
> # /sbin/route
> を実行すると
> Kernel IP routing table
> Destination Gateway Genmask Flags Metric Ref Use Iface
> 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
> 192.168.1.0 * 255.255.255.0 U 0 0 0 eth0
> 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
> 192.168.0.0 * 255.255.255.0 U 0 0 0 eth1
> loopback * 255.0.0.0 U 0 0 0 lo
> 172.16.7.230 * 255.255.255.255 UH 0 0 0 ppp0
> default 172.16.7.230 0.0.0.0 UG 1 0 0 ppp0
>
> のように表示されます。
> 最下行の default が default gateway です。(表示位置が必ず最下行に
> なるとは限りません)
>
> 他人?がいると勝手な IP を使用したり Virus に勝手に?かかったりします。
> サーバへのいたずらも外部からより内部の行動が多いと言われています。
> 悪意が無くても行動が同じならば同じ影響が出ます。
> 家族だけで使用する場合でも、各々のホストに適当なガードをかけることによって間違っ
> た操作からの影響を免れることが出来ます。
> MASQUERADE の IP を制限すると「つながりません」と言う言葉で問題が
> 伝えられることがあります。
>
>---------------------
> もし、サーバなどの運用が無ければ下記の設定くらいをして下さい。何も
> せずに接続するのは、むきみの貝みたいなものです。
> iptables -P INPUT DROP
> iptables -P FORWARD DROP
> iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type echo-request -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type echo-reply -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type destination-unreachable -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type port-unreachable -j ACCEPT
> iptables -A INPUT -p icmp --icmp-type time-exceeded -j ACCEPT
> iptables -A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A INPUT -p tcp ! --syn -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type echo-request -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type echo-request -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type echo-reply -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type destination-unreachable -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type port-unreachable -j ACCEPT
> iptables -A FORWARD -p icmp --icmp-type time-exceeded -j ACCEPT
> iptables -A FORWARD -m state --state ESTABLISHED,RELATED -j ACCEPT
> iptables -A FORWARD -p tcp ! --syn -j ACCEPT
>
> samba を使っているならば
> iptables -A INPUT -i eth0 -p tcp --destination-port 135:139 -j ACCEPT
> iptables -A INPUT -i eth0 -p udp --destination-port 135:139 -j ACCEPT
>
> nfs を使っているならば
> iptables -A INPUT -i eth0 -p tcp destination-port 111 -j ACCEPT
> iptables -A INPUT -i eth0 -p udp destination-port 111 -j ACCEPT
> iptables -A INPUT -i eth0 -p tcp destination-port 2049 -j ACCEPT
> iptables -A INPUT -i eth0 -p udp destination-port 2049 -j ACCEPT
> iptables -A INPUT -i eth0 -p tcp destination-port mountd -j ACCEPT
> iptables -A INPUT -i eth0 -p udp destination-port mountd -j ACCEPT
> iptables -A INPUT -i eth0 -p tcp destination-port nlockmgr -j ACCEPT
> iptables -A INPUT -i eth0 -p udp destination-port nlockmgr -j ACCEPT
> この中で mountd と nlockmgr は
> # rpcinfo -p
> で調べて下さい。
>
---
Best Regards,
Hitoshi TANIMURA
http://glessb.hp.infoseek.co.jp/
- References
-
- [plamo:24254] Q again for IP_MASCUERADE, tanimura
- [plamo:24257] Re: Q again for IP_MASCUERADE, KATOH Yasufumi
- [plamo:24270] Re: Q again for IP_MASCUERADE, tanimura
- [plamo:24271] Re: Q again for IP_MASCUERADE, 早間義博
[検索ページ]
[メール一覧]
Plamo ML 公開システム