When using multiple VLANs, some funky stuff can sometimes happen when
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 12 May 2011 00:24:46 +0000 (10:24 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Thu, 12 May 2011 02:02:19 +0000 (12:02 +1000)
adding/removing IP addresses causing routes might be dropped by the system.

The easiest workaround for this is to unconditionally try to reapply
all static routes for all interfaces once ipreallocation has finished,
not just adding them back on the affected interface.

This worksaround a funky issue in
CQ S1023538

config/events.d/11.routing

index c265c382d0c60008ab7043ed57dd3ce728a5ea74..2dd6208f1e7130ade9e4db5f61143ef745a2d8d4 100755 (executable)
@@ -19,14 +19,12 @@ loadconfig
     exit 0
 }
 
-case "$1" in 
-    takeip|releaseip)
-       iface=$2
-       cat $CTDB_BASE/static-routes | egrep "^$iface " | while read IFACE DEST GW; do
-           ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null
-       done
-       ;;
-
+case "$1" in
+    recovered|ipreallocated)
+        cat $CTDB_BASE/static-routes | while read IFACE DEST GW; do
+            ip route add $DEST via $GW dev $IFACE >/dev/null 2>/dev/null
+        done
+        ;;
     *)
        ctdb_standard_event_handler "$@"
        ;;