Lvs DR mode configuration
#! /Bin/bash # lvs setting # DIP # eth0: 192.168.233.145 # VIP # eth0: 0 192.168.233.250/32 # RIP1: 192.168.233.146 # RIP2: 192.168.233.147 # VIP #192.168.233.250/32 case $1 inrip) # VIP: iptables-Fsetenforce 0 echo 1>/proc/sys/net/ipv4/conf/lo/arp_ignoreecho 1>/proc/sys/net/ipv4/conf/all/arp_ignoreecho 2>/ proc/sys/net/ipv4/conf/lo/arp_announceecho 2>/proc/sys/net/ipv4/conf/all/arp_announceifconfig lo: 0 192.168.233.250 netmask 255.255.255.255.255 broadcast 192.168.233.250 uproute add-host 192.168.233.250 dev lo: 0; dip) # DIP: iptables-Fsetenforce 0 echo 1>/proc/sys/net/ipv4/ip_forwardifconfig eth0: 0 192.168.233.250 netmask 255.255.255.255 broadcast 192.168.233.250 up1_sadm-c1_sadm-A-t 192.168.23250: 80-s wlc1_sadm-a-t 192.168.233.250: 80-r 192.168.233.146-g1_sadm-a-t 192.168.233.250: 80-r 192.168.233.147-g1_sadm-Ln; esac # End #