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:06:45 +0000 (12:06 +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 9a1fdef788d9279dd237c7a8e2e2a9f706cb69dc..b6093a2a43829afb6772f27d708dd4093b005917 100755 (executable)
@@ -19,13 +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
+        ;;
 
     updateip)
        oiface=$2