- 论坛徽章:
- 1
|
编辑/etc/rc2.d/S70staticroutes文件,可以加入目标主机(target),防止router失效时,cluster的公用网络资源不可用。
文件格式如下:
#!/sbin/sh
# /etc/rc2.d/S70staticroutes /etc/init.d/staticroutes
# Copyright (c) 2003 by Sun Microsystems, Inc.
# All rights reserved.
#
#ident "@(#)staticroutes 1.0.1
#
#
# This file refers to infodoc #70062. Please read it for
# further information.
#
#
################################################################################
# This script is not needed for most installations ! #
# #
# It MAY be needed for rare special customizations. In this case, #
# copy the script and edit the following example code to suit your needs. #
################################################################################
#
# Depending on your changes, this script overwrites Sun recommended default
# values (To use the default values, you do not need this script). See Product
# Documentation and SunSolve Infodocs for proper use first
#
#
# Edit the following IPMP test TARGETS to suit your needs.
# To install:
# 1) cp S70staticroutes to /etc/rc2.d
# 2) perform edits on the sript as required
# 3) chmod 744 /etc/rc2.d/S70staticroutes
# 4) chown root:sys /etc/rc2.d/S70staticroutes
# 5) ln /etc/rc2.d/S70staticroutes /etc/init.d/staticroutes
#
#TARGET1=172.20.20.110
#TARGET2=172.20.20.120
#TARGET3=172.20.20.130
#TARGET4=172.20.20.140
#TARGET5=172.20.20.150
#TARGET6=172.20.20.160
#TARGET7=172.20.20.170
#TARGET8=172.20.20.180
#TARGET9=172.20.20.190
case "$1" in
'start')
/usr/bin/echo "Adding static routes for IPMP ..."
# /usr/sbin/route add host $TARGET1 $TARGET1
# /usr/sbin/route add host $TARGET2 $TARGET2
# /usr/sbin/route add host $TARGET3 $TARGET3
# /usr/sbin/route add host $TARGET4 $TARGET4
# /usr/sbin/route add host $TARGET5 $TARGET5
# /usr/sbin/route add host $TARGET6 $TARGET6
# /usr/sbin/route add host $TARGET7 $TARGET7
# /usr/sbin/route add host $TARGET8 $TARGET8
# /usr/sbin/route add host $TARGET9 $TARGET9
# /usr/sbin/route add net x.x.x.x z.z.z.z
;;
'stop')
/usr/bin/echo "Deleting static routes for IPMP ..."
# /usr/sbin/route delete host $TARGET1 $TARGET1
# /usr/sbin/route delete host $TARGET2 $TARGET2
# /usr/sbin/route delete host $TARGET3 $TARGET3
# /usr/sbin/route delete host $TARGET4 $TARGET4
# /usr/sbin/route delete host $TARGET5 $TARGET5
# /usr/sbin/route delete host $TARGET6 $TARGET6
# /usr/sbin/route delete host $TARGET7 $TARGET7
# /usr/sbin/route delete host $TARGET8 $TARGET8
# /usr/sbin/route delete host $TARGET9 $TARGET9
# /usr/sbin/route delete net x.x.x.x z.z.z.z
;;
esac
[ 本帖最后由 byuq 于 2007-4-13 17:09 编辑 ] |
|