Red Hat Training

A Red Hat training course is available for Red Hat Enterprise Linux

3.5.3. ネットワークパケットフィルタルールの作成

Before assigning any iptables rules for FTP service, review the information in 「ファイアウォールマークの割り当て」 concerning multi-port services and techniques for checking the existing network packet filtering rules.
Below are rules which assign the same firewall mark, 21, to FTP traffic. For these rules to work properly, you must also use the VIRTUAL SERVER subsection of Piranha Configuration Tool to configure a virtual server for port 21 with a value of 21 in the Firewall Mark field. See 仮想サーバー サブセクション」 for details.

3.5.3.1. アクティブ接続のルール

アクティブ接続のルールはカーネルに対して、ポート 20 — FTP データポート上にある 内部浮動 IP アドレスへ届く接続を受け付けて転送するように指示します。
以下の iptables コマンドにより、LVS router は、IPVS が認識していない 実サーバーからの外向けの接続を受け付けることが出来ます:
/sbin/iptables -t nat -A POSTROUTING -p tcp -s n.n.n.0/24 --sport 20 -j MASQUERADE
In the iptables command, n.n.n should be replaced with the first three values for the floating IP for the NAT interface's internal network interface defined in the GLOBAL SETTINGS panel of Piranha Configuration Tool.