def check_public_floating_ranges_intersection(self):
        pub = [ng for ng in self.networks
               if ng['name'] == consts.NETWORKS.public][0]
        # Check intersection of networks address spaces inside
        # Public and Floating network
        pub_ranges_err = False
        nets = {
            consts.NETWORKS.public: [
                netaddr.IPRange(v[0], v[1]) for v in pub['ip_ranges']
            ],
            'floating': [
                netaddr.IPRange(v[0], v[1])
                for v in self.network_config['floating_ranges']
            ]
        }
        for name, ranges in six.iteritems(nets):
            ids = [pub['id']] if name == consts.NETWORKS.public else []
            for npair in combinations(ranges, 2):
                if self.net_man.is_range_intersection(npair[0], npair[1]):
                    self.err_msgs.append(
                        u"Address space intersection between ranges "
                        u"of {0} network.".format(name)
                    )
                    self.result.append({"ids": ids,
                                        "errors": ["ip_ranges"]})
            for net in ranges:
                # Check intersection of public GW and pub/float IP ranges
                if netaddr.IPAddress(pub['gateway']) in net:
                    self.err_msgs.append(
                        u"Address intersection between "
                        u"public gateway and IP range "
                        u"of {0} network.".format(name)
                    )
                    self.result.append({"ids": ids,
                                        "errors": ["gateway",
                                                   "ip_ranges"]})
                # Check that public IP ranges are in public CIDR
                if name == consts.NETWORKS.public:
                    if net not in netaddr.IPNetwork(pub['cidr']) \
                            and not pub_ranges_err:
                        pub_ranges_err = True
                        self.err_msgs.append(
                            u"Public gateway and public ranges "
                            u"are not in one CIDR."
                        )
                        self.result.append({"ids": ids,
                                            "errors": ["gateway",
                                                       "ip_ranges"]})
        self.expose_error_messages()

        # Check intersection of public and floating ranges
        for npair in combinations(
                nets[consts.NETWORKS.public] + nets['floating'], 2):
            if self.net_man.is_range_intersection(npair[0], npair[1]):
                self.err_msgs.append(
                    u"Address space intersection between range "
                    u"of public network and floating range."
                )
                self.result.append({"ids": [pub['id']],
                                    "errors": ["ip_ranges"]})
        self.expose_error_messages()
Check public floating ranges intersection
dataset/ETHPy150Open openstack/fuel-web/nailgun/nailgun/extensions/network_manager/checker.py/NetworkCheck.check_public_floating_ranges_intersection