Menu Close

Red Hat Training

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

3.5.3. Criando Regras do Filtro de Pacote da Rede

Before assigning any iptables rules for FTP service, review the information in Seção 3.4.1, “Designando Marcas Firewall ” 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 Seção 4.6.1, “A Subseção do SERVIDOR VIRTUAL for details. Regras para Conexões Ativas

As regras para conexões ativas avisam o Kernel a aceitar e enviar conexões ao endereço IP flutuante interno no portal 20 — o portal de dados FTP.
O seguinte comando iptables permite o roteador a aceitar as conexões de saída dos servidores reais, onde o IPVS não possui conhecimento a respeito:
/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.