When we are no longer the natgw master, dont put the natgw ip on loopback.
[metze/ctdb/wip.git] / config / events.d / 11.natgw
index 512f8dee8e6a86b2fc130f4e0cf1bd71da3a1615..1d5ba0f5570a804a7d5e782259cc002aec300667 100755 (executable)
@@ -91,8 +91,10 @@ case "$1" in
                # We do this so that the ip address will exist on a
                # non-loopback interface so that samba may send it along in the
                # KDC requests.
-               ip addr add $CTDB_NATGW_PUBLIC_IP_HOST dev lo scope host
                ip route add 0.0.0.0/0 via $NATGWIP metric 10
+               # Make sure winbindd does not stay bound to this address
+               # if we are no longer natgwmaster
+               smbcontrol winbindd ip-dropped $CTDB_NATGW_PUBLIC_IP >/dev/null 2>/dev/null
        fi
 
        # flush our route cache