Saving Network Packet Filter Settings - Red Hat ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION Manual

Hide thumbs Also See for ENTERPRISE LINUX 5 - VIRTUAL SERVER ADMINISTRATION:
Table of Contents

Advertisement

The following iptables commands have the net effect of assigning any traffic addressed to the
floating IP on the appropriate ports a firewall mark of 21, which is in turn recognized by IPVS and
forwarded appropriately:
/sbin/iptables -t mangle -A PREROUTING -p tcp -d n.n.n.n/32 --dport 21 -j
MARK --set-mark 21
/sbin/iptables -t mangle -A PREROUTING -p tcp -d n.n.n.n/32 --dport
10000:20000 -j MARK --set-mark 21
In the iptables commands, n.n.n.n should be replaced with the floating IP for the FTP virtual
server defined in the VIRTUAL SERVER subsection of Piranha Configuration Tool.
Warning
The commands above take effect immediately, but do not persist through a reboot of
the system. To ensure network packet filter settings are restored after a reboot, see
Section 3.6, "Saving Network Packet Filter Settings"
Finally, you need to be sure that the appropriate service is set to activate on the proper runlevels. For
Section 2.1, "Configuring Services on the LVS
more on this, refer to

3.6. Saving Network Packet Filter Settings

After configuring the appropriate network packet filters for your situation, save the settings so they get
restored after a reboot. For iptables, type the following command:
/sbin/service iptables save
This saves the settings in /etc/sysconfig/iptables so they can be recalled at boot time.
Once this file is written, you are able to use the /sbin/service command to start, stop, and check
the status (using the status switch) of iptables. The /sbin/service will automatically load the
appropriate module for you. For an example of how to use the /sbin/service command, see
Section 2.3, "Starting the Piranha Configuration Tool
Finally, you need to be sure the appropriate service is set to activate on the proper runlevels. For more
Section 2.1, "Configuring Services on the LVS
on this, see
The next chapter explains how to use the Piranha Configuration Tool to configure the LVS router
and describe the steps necessary to activate LVS.
Saving Network Packet Filter Settings
Routers".
Service".
Routers".
29

Advertisement

Table of Contents
loading

Table of Contents