1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#!/bin/bash
# author: kuangl
# mail: kuangl@orient-meida.com
# description: The configuration file to configure the real server.
# -------------------------------------------------------- #
       # REAL_SEVER_CONFINGE_FILE
# -------------------------------------------------------- #
# source function library
/etc/rc .d /init .d /functions
# Real server IP configure
LVS_VIP=192.168.122.15
NET_MASK=255.255.255.255
start()
{
       # Start daemons.
       ifconfig  lo:0 $LVS_VIP netmask $NET_MASK broadcast $LVS_VIP
       route add -host $LVS_VIP dev lo:0
       echo  "1"  /proc/sys/net/ipv4/conf/lo/arp_ignore
       echo  "1"  /proc/sys/net/ipv4/conf/all/arp_ignore
       echo  "2"  /proc/sys/net/ipv4/conf/lo/arp_announce
       echo  "2"  /proc/sys/net/ipv4/conf/all/arp_announce
       echo  "RealServer Start OK"
}
stop()
{
       ifconfig  lo:0 down
       route del $LVS_VIP
       echo  "RealServer Stop  OK"
}
case  "$1"  in
   start)
        start
   ;;
   stop)
       stop
   ;;
   *)
     echo  $ "Usage: $0 {start|stop}"
     exit  1
esac
exit  $?