This topology provides a highly available service with minimal hardware requirements. See the overview. for information on how this setup works.
The documentation that follows assumes that all nodes on the network are set up with correct interfaces and routes for each network they are connected to as per the diagram above. The default route for the real servers is assumed to be the router, but may be an alternate route if available.
This example builds on the example of a high availability single virtual service and adds the ability to have RFC 1519, CIDR networks of virtual addresses. The configuration steps for the single virtual service are required in addition to the configuration below.
IPV4 forwarding must be enabled. This is done by modifying the line containing net.ipv4.ip_forward in /etc/sysctl.conf. An example /etc/sysctl.conf follows:
# Enables packet forwarding net.ipv4.ip_forward = 1 # Enables source route verification net.ipv4.conf.default.rp_filter = 1For these changes to take effect the sysctl command may be used:
/sbin/sysctl -p net.ipv4.ip_forward = 1 net.ipv4.conf.default.rp_filter = 1 kernel.sysrq = 0
To route 192.168.0.0/24 to 192.168.6.240, add an entry to /etc/sysconfig/static-routes.
any net 192.168.0.0 netmask 255.255.255.0 gw 192.168.6.240
Restarting networking on the machine will make this change take effect.
/etc/init.d/network restart Shutting down interface eth0: [ OK ] Setting network parameters: [ OK ] Bringing up interface lo: [ OK ] Bringing up interface eth0: [ OK ]
You can verify that this worked using the ip command.
/sbin/ip route list 192.168.0.0/24 192.168.0.0/24 via 192.168.6.240 dev eth0
To route 192.168.0.0/24 to 192.168.6.240, add up and pre-down lines to lines to the entry in /etc/network/interfaces for the interface that is connected to the Reali Servers. A sample entry for eth0 follows:
auto eth0 iface eth0 inet static address 192.168.6.1 netmask 255.255.255.0 up ip route add 192.168.0.0/24 via 192.168.6.240 pre-down ip route del 192.168.0.0/24 via 192.168.6.240
Restarting networking on the machine will make this change take effect.
/etc/init.d/networking restart Reconfiguring network interfaces... done.
You can verify that this worked using the ip command.
/sbin/ip route list 192.168.0.0/24 192.168.0.0/24 via 192.168.6.240 dev eth0
Please follow the steps for configuring real servers for a high availability single virtual service before continuing.
The real servers need to be configured to see traffic for the virtual addresses in 192.168.0.0/24 as local. This can be done by making use of an IP alias on the loopback device.
The file /etc/sysconfig/network-scripts/ifcfg-lo:0 configures the lo:0 interface, an example follows:
DEVICE=lo:0 IPADDR=192.168.0.0 NETMASK=255.255.255.0 NETWORK=192.168.0.0 BROADCAST=192.168.0.255 ONBOOT=yes NAME=loopback
To avoid unnecessary warnings you should ensure that the gateway device is set to the ethernet interface. The following line from /etc/sysconfig/network sets the gateway device to eth0.
GATEWAYDEV=eth0To bring up the IP alias the ifup command is used:
/sbin/ifup lo
The lo:0 interface can be configured by adding an entry to /etc/network/interfaces, an example showing the lo and lo:0 interfaces follows.
auto lo iface lo inet loopback auto lo:0 iface lo:0 inet static address 192.168.0.0 netmask 255.255.255.0To bring up the IP alias the ifup command is used:
/sbin/ifup lo:0
/sbin/ifconfig
lo:0 Link encap:Local Loopback
inet addr:192.168.0.0 Mask:255.255.255.0
UP LOOPBACK RUNNING MTU:3924 Metric:1
Note: The netmask of 255.255.255.0 on the lo:0
interface indicates that this interface will accept traffic for all of the
addresses in
network 192.168.0.0 netmask 255.255.255.0.
This behaviour is peculiar to the
loopback interface (lo) and aliases.
Copyright © 2000-2005,
Horms
Last Updated: Tue May 17 17:37:24 2005 +0900
Debian is a registered trademark of Software in the Public Interest, Inc.
Red Hat, the Red Hat Shadowman logo and Fedora are
registered trademarks of Red Hat, Inc.
Red Hat may also be refered to as RedHat on this site.
Linux is a registered trademark of Linus Torvalds.
All other trademarks are the property of their respective owners.