RB: How to put in Draining mode

Create and use the following script:

cat > closeRB.sh
#!/bin/bash

usage() {
  cat <<EOF

Usage:
      $0 open|close

      Script to open/close the RB with iptables rules.

EOF
}

RB=`/bin/hostname`
#echo "RB="$RB
echo "/sbin/iptables -D INPUT -p tcp --source $RB --destination-port
9002 -j ACCEPT"
case "$1" in
  open)
    /sbin/iptables -D INPUT -p tcp --source 127.0.0.1 --destination-port 9002 -j ACCEPT
    /sbin/iptables -D INPUT -p tcp --source $RB --destination-port 9002 -j ACCEPT
    /sbin/iptables -D INPUT -p tcp --destination-port 9002 -j REJECT
    ;;

  close)
    /sbin/iptables -I INPUT 1 -p tcp --source 127.0.0.1 --destination-port 9002 -j ACCEPT
    /sbin/iptables -I INPUT 2 -p tcp --source $RB --destination-port 9002 -j ACCEPT
    /sbin/iptables -I INPUT 4 -p tcp --destination-port 9002 -j REJECT
    ;;

  *)
    usage
    exit

esac

[Ctrl-C]

chmod 755 closeRB.sh

Suggested by this link.

doc/use_cases/rb_drain.txt · Last modified: 2008/12/22 11:01 by dallafina
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0