Red Hat Training

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

3.5.3. Creazione delle regole per il filtro dei pacchetti di rete

Before assigning any iptables rules for FTP service, review the information in Sezione 3.4.1, «Assegnazione dei firewall mark» 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 Sezione 4.6.1, «La sottosezione SERVER VIRTUALE» for details.

3.5.3.1. Regole per collegamenti attivi

Le regole per i collegamenti attivi indicano al kernel di accettare ed inoltrare i collegamenti in arrivo nell'indirizzo IP floating interno sulla porta 20 — la porta dei dati FTP.
Il seguente comando iptables permette al router LVS di accettare i collegamenti in uscita dai real server non conosciuti da 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.