If the admin makes a configuration mistake and configures NATGW to use the
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 27 Apr 2010 22:46:41 +0000 (08:46 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Tue, 27 Apr 2010 22:51:06 +0000 (08:51 +1000)
same ip address as a normal public-address,
check for this in the natgw script and warn the user.

Also prevent ctdb from starting up since this configuration will not work.

BZ60933

config/events.d/11.natgw

index b226b8110b369bc32fdc59de6aa3aac779a29f96..e6e54f48dc2b1b3c988ff5ce28ca414297a44543 100644 (file)
@@ -27,6 +27,15 @@ delete_all() {
 
 case "$1" in 
     startup)
+       [ -z "$CTDB_PUBLIC_ADDRESSES" ] && {
+               CTDB_PUBLIC_ADDRESSES=/etc/ctdb/public_addresses
+       }
+       egrep "^$CTDB_NATGW_PUBLIC_IP[ \t]" $CTDB_PUBLIC_ADDRESSES >/dev/null
+       [ "$?" = "0" ] && {
+               echo ERROR: NATGW configured to use a public address. NATGW must not use a public address.
+               exit 1
+       }
+
        # do not respond to ARPs that are for ip addresses with scope 'host'
        echo 3 > /proc/sys/net/ipv4/conf/all/arp_ignore
        # do not send out arp requests from loopback addresses