-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathreal_server.sh
53 lines (41 loc) · 1.05 KB
/
real_server.sh
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
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
# author: kuangl
# mail: [email protected]
# 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_MAST=255.255.255.255
start()
{
# Start daemons.
ifconfig lo:0 $LVS_IP netmask $NET_MASK broadcast $LVS_IP
route add -host $LVS_IP 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_IP
echo "RealServer Stop OK"
}
case "$1" in
start)
start
;;
stop)
stop
;;
*)
echo $"Usage: $0 {start|stop}"
exit 1
esac
exit $?