Deal with orphaned nodes

When a node becomes orphaned, it no longer has a gateway IP address.
This commit tries to assign a gateway IP, but will fail gracefully.