func (p *ipPoolProvider) NewIpPool(numOfNeededIPs int) *bftinput.IpPool {
	if numOfNeededIPs == 0 {
		numOfNeededIPs = rand.Intn(10)
	}

	if p.gatewayFourthOctet == 1 {
		p.gatewayFourthOctet = 254
	} else {
		p.gatewayFourthOctet = 1
	}

	prefix := fmt.Sprintf("192.168.%d", p.called)
	p.called += 1

	numberOfReservedBorders := rand.Intn(6) // up to 6 borders of reserved ranges

	usedIps := []int{}
	reservedBorders := []int{}

	firstStaticIp := 200

	for _, i := range rand.Perm(firstStaticIp) {
		if i != 0 && i != p.gatewayFourthOctet {
			if len(usedIps) < numOfNeededIPs {
				usedIps = append(usedIps, i)
			} else if len(reservedBorders) < numberOfReservedBorders {
				reservedBorders = append(reservedBorders, i)
			} else {
				break
			}
		}
	}

	sort.Ints(usedIps)
	sort.Ints(reservedBorders)

	decider := bftdecider.NewRandomDecider()
	reservedRangeGenerator := NewReservedRangeGenerator(prefix, decider)
	reservedRanges := reservedRangeGenerator.Generate(usedIps, reservedBorders)

	return bftinput.NewIpPool(
		prefix,
		p.gatewayFourthOctet,
		reservedRanges,
	)
}
					CloudConfig: bftinput.CloudConfig{
						AvailabilityZones: []bftinput.AvailabilityZone{
							{
								Name: "z1",
							},
							{
								Name: "z2",
							},
						},
						Networks: []bftinput.NetworkConfig{
							{
								Name: "foo-network",
								Subnets: []bftinput.SubnetConfig{
									{
										AvailabilityZones: []string{"z1"},
										IpPool:            bftinput.NewIpPool("192.168.1", 1, []string{}),
									},
									{
										AvailabilityZones: []string{"z2"},
										IpPool:            bftinput.NewIpPool("192.168.2", 1, []string{}),
									},
								},
							},
						},
					},
					Jobs: []bftinput.Job{
						{
							Name:              "foo-job",
							AvailabilityZones: []string{"z1", "z2"},
							Networks: []bftinput.JobNetworkConfig{
								{
	)

	BeforeEach(func() {
		rand.Seed(64)

		networks = [][]string{[]string{"manual", "vip"}}
		nameGenerator := &fakebftnamegen.FakeNameGenerator{}
		nameGenerator.Names = []string{"foo-net", "bar-net", "baz-net", "qux-net"}
		ipPoolProvider := &fakebftnetwork.FakeIpPoolProvider{}
		vipPool := &bftinput.IpPool{}
		ipPoolProvider.RegisterIpPool(vipPool)

		ipPool := bftinput.NewIpPool(
			"192.168.0",
			1,
			[]string{
				"192.168.0.15-192.168.0.58",
				"192.168.0.157-192.168.0.203",
			},
		)
		ipPoolProvider.RegisterIpPool(ipPool)
		ipPoolProvider.RegisterIpPool(ipPool)

		ipPoolProvider.RegisterIpPool(ipPool)
		ipPoolProvider.RegisterIpPool(ipPool)

		expectedIpPool = ipPool
		// reserving 2 ips since we have 2 instances
		expectedIpPool.NextStaticIp()
		expectedIpPool.NextStaticIp()

		decider = &fakebftdecider.FakeDecider{}