'Prepare network
Creates network with given number of IPv6 subnets in the given mode and
one IPv4 subnet.
Creates router with ports on all subnets.
if dualnet - create IPv6 subnets on a different network
:return: list of created networks'

def prepare_network(self, address6_mode, n_subnets6=1, dualnet=False):

    network = self._create_network()
    if dualnet:
        network_v6 = self._create_network()
    sub4 = self._create_subnet(network=network, namestart='sub4', ip_version=4)
    router = self._get_router()
    self.routers_client.add_router_interface(router['id'], subnet_id=sub4['id'])
    self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.routers_client.remove_router_interface, router['id'], subnet_id=sub4['id'])
    self.subnets_v6 = []
    for _ in range(n_subnets6):
        net6 = (network_v6 if dualnet else network)
        sub6 = self._create_subnet(network=net6, namestart='sub6', ip_version=6, ipv6_ra_mode=address6_mode, ipv6_address_mode=address6_mode)
        self.routers_client.add_router_interface(router['id'], subnet_id=sub6['id'])
        self.addCleanup(test_utils.call_and_ignore_notfound_exc, self.routers_client.remove_router_interface, router['id'], subnet_id=sub6['id'])
        self.subnets_v6.append(sub6)
    return ([network, network_v6] if dualnet else [network])
