|
INADDR_ANY instead of the virtual IP addresses.To configure direct routing using the iptables method, perform the following steps:1. On each real server, run the following command for every VIP, port, and protocol (TCP orUDP) combination intended to be serviced for the real server:iptables -t nat -A PREROUTING -p -d --dport -jREDIRECTThis command will cause the real servers to process packets destined for the VIP and portthat they are given.2. Save the configuration on each real server:# service iptables save# chkconfig --level 2345 iptables onThe commands above cause the system to reload the iptables configuration on bootup —before the network is started.3. Putting the Configuration TogetherAfter determining which of the preceding routing methods to use, the hardware should be linkedtogether on the network.ImportantThe adapter devices on the LVS routers must be configured to access the samenetworks. For instance if eth0 connects to public network and eth1 connects tothe private network, then these same devices on the backup LVS router mustconnect to the same networks.Also the gateway listed in the first interface to come up at boot time is added tothe routing table and subsequent gateways listed in other interfaces are ignored.This is especially important to consider when configuring the real servers.After physically connecting together the hardware, configure the network interfaces on theprimary and backup LVS routers. This can be done using a graphical application such assystem-config-network or by editing the network scripts manually. For more information aboutadding devices using system-config-network, see the chapter titled Network Configuration inthe Red Hat Enterprise Linux Deployment Guide. For the remainder of the chapter, examplealterations to network interfaces are made either manually or through the PiranhaConfiguration Tool.Putting the Configuration Together29
PreviousNext |