[Kea-users] subnet full - reselect

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[Kea-users] subnet full - reselect

itay cohen
hi guys

i have this 2 subnets with the same relay address,
when the first pool is full i would expect that kea will select address from the other pool (with the new subnet reselect feature), instead it gives an error: "[kea-dhcp4.alloc-engine/16960] ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1 00:0c:29:45:76:11], cid=[01:00:0c:29:45:76:11], tid=0x94f6b45f: failed to allocate an IPv4 address after 1 attempt(s)"

this is the configuration example:

        {
            "id": 1003,
            "subnet": "172.20.220.128/28",
            "pools": [
                {
                    "pool": "172.20.220.130-172.20.220.130" }
            ],
            "relay": {
                "ip-address": "172.20.220.129"
            },
            "option-data": [
                {
                    "name": "routers",
                    "data": "172.20.220.129"
                }
            ]
        },
        {
            "id": 11131,
            "subnet": "172.20.221.144/28",
            "pools": [
                {
                    "pool": "172.20.221.146-172.20.221.150" }
            ],
            "relay": {
                "ip-address": "172.20.220.129"
            },
            "option-data": [
                {
                    "name": "routers",
                    "data": "172.20.221.145"
                }
            ]
        }

please advise ..
thank you
itay,

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] subnet full - reselect

Francis Dupont
Are your two subnets in a shared network? (if there are not pools are not
shared)

Regards

Francis Dupont <[hidden email]>
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] subnet full - reselect

itay cohen
Does radius hook support shared network ?

-------- Original message --------
From: Francis Dupont <[hidden email]>
Date: 9/10/18 17:41 (GMT+02:00)
To: itay cohen <[hidden email]>
Subject: Re: [Kea-users] subnet full - reselect

Are your two subnets in a shared network? (if there are not pools are not
shared)

Regards

Francis Dupont <[hidden email]>

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] subnet full - reselect

Francis Dupont
Radius hooks do not support shared networks. But it supports subnet re-select
even it is a bit late when the allocation returns a pool full error.

Regards

Francis Dupont <[hidden email]>
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] subnet full - reselect

fviktor
In reply to this post by itay cohen
I have the same problem.

Simple setup with two subnets, one address available in each:

{
  "Dhcp4": {
    "expired-leases-processing": {
      "flush-reclaimed-timer-wait-time": 25,
      "hold-reclaimed-time": 3600,
      "max-reclaim-leases": 100,
      "max-reclaim-time": 250,
      "reclaim-timer-wait-time": 10,
      "unwarned-reclaim-cycles": 5
    },
    "lease-database": {
      "type": "memfile"
    },
    "interfaces-config": {
        "interfaces": [
            "br0/10.10.128.1",
            "br0/10.10.128.5"
        ],
        "dhcp-socket-type": "raw"
    },
    "option-data": [
      {
        "data": "10.10.128.1",
        "name": "domain-name-servers"
      },
      {
        "csv-format": false,
        "data": "056e6574656d096d6963726f736f667403636f6d00",
        "name": "domain-search"
      }
    ],
    "subnet4": [
      {
        "id": 1,
        "option-data": [
          {
            "data": "10.10.128.1",
            "name": "routers"
          }
        ],
        "relay": {
            "ip-address": "10.10.128.1"
        },
        "pools": [
          {
            "pool": "10.10.128.2/32"
          }
        ],
        "subnet": "10.10.128.0/30"
      },
      {
        "id": 2,
        "option-data": [
          {
            "data": "10.10.128.5",
            "name": "routers"
          }
        ],
        "relay": {
            "ip-address": "10.10.128.5"
        },
        "pools": [
          {
            "pool": "10.10.128.6/32"
          }
        ],
        "subnet": "10.10.128.4/30"
      }
    ],
    "valid-lifetime": 120
  },
  "Logging": {
    "loggers": [
      {
        "debuglevel": 99,
        "name": "kea-dhcp4",
        "output_options": [
          {
            "output": "/var/log/kea-dhcp4.log"
          }
        ],
        "severity": "DEBUG"
      }
    ]
  }
}

First client gets the IP from the first subnet assigned as expected:

address,hwaddr,client_id,valid_lifetime,expire,subnet_id,fqdn_fwd,fqdn_rev,hostname,state
10.10.128.2,f2:00:00:00:b1:00,,120,1537202052,1,0,0,virtual-test-blk1.,0

Second client does not get an IP, but instead an error is logged by Kea:

2018-09-17 16:33:22.062 DEBUG [kea-dhcp4.dhcpsrv/13520]
DHCPSRV_MEMFILE_GET_SUBID_HWADDR
obtaining IPv4 lease for subnet ID 1 and hardware address hwtype=1
f2:00:00:00:b1:01
2018-09-17 16:33:22.062 DEBUG [kea-dhcp4.alloc-engine/13520]
ALLOC_ENGINE_V4_OFFER_NEW_LE
ASE allocation engine will try to offer new lease to the client [hwtype=1
f2:00:00:00:b1:
01], cid=[no info], tid=0xa1f8655b
2018-09-17 16:33:22.062 DEBUG [kea-dhcp4.hosts/13520]
HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS
4 get one host with reservation for subnet id 1 and IPv4 address 10.10.128.2
2018-09-17 16:33:22.063 DEBUG [kea-dhcp4.hosts/13520]
HOSTS_CFG_GET_ALL_ADDRESS4 get all
hosts with reservations for IPv4 address 10.10.128.2
2018-09-17 16:33:22.063 DEBUG [kea-dhcp4.hosts/13520]
HOSTS_CFG_GET_ALL_ADDRESS4_COUNT us
ing address 10.10.128.2, found 0 host(s)
2018-09-17 16:33:22.063 DEBUG [kea-dhcp4.hosts/13520]
HOSTS_CFG_GET_ONE_SUBNET_ID_ADDRESS
4_NULL host not found using subnet id 1 and address 10.10.128.2
2018-09-17 16:33:22.063 DEBUG [kea-dhcp4.dhcpsrv/13520]
DHCPSRV_MEMFILE_GET_ADDR4 obtaini
ng IPv4 lease for address 10.10.128.2
2018-09-17 16:33:22.063 WARN  [kea-dhcp4.alloc-engine/13520]
ALLOC_ENGINE_V4_ALLOC_FAIL [hwtype=1 f2:00:00:00:b1:01], cid=[no info],
tid=0xa1f8655b: *failed to allocate an IPv4 address after 1 attempt(s)*
2018-09-17 16:33:22.063 DEBUG [kea-dhcp4.bad-packets/13520]
DHCP4_PACKET_NAK_0003 [hwtype=1 f2:00:00:00:b1:01], cid=[no info],
tid=0xa1f8655b: failed to advertise a lease, client sent ciaddr 0.0.0.0,
requested-ip-address (no address)

Tried to use the 10.10.128.2 - 10.10.128.2 syntax for the pool definition,
no change.
Tried to vary the relay and options, no change.
Tried to add/remove subnet IDs, same problem.
Tried to add interface definition to each subnet, that broke address
allocation completely.
Tried to define just br0 in interfaces-config, that resulted in multiple
responses being sent.

*Could you please give us the simplest working configuration for this case
of multiple subnets with a small (single address) pool each, so we can use
it as an example?
*

Thank you.



--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users
Reply | Threaded
Open this post in threaded view
|

Re: [Kea-users] subnet full - reselect

fviktor
Update: I'm trying to use Kea 1.0.0 on Ubuntu 16.04.

Apparently this setup would require the use of the  shared-networks
<ftp://ftp.isc.org/isc/kea/1.3.0/doc/kea-guide.html#shared-network4>  
feature to set up, which is supported in Kea 1.3.0 and up. So I have to
upgrade.

Relevant example:
https://gitlab.isc.org/isc-projects/kea/blob/master/doc/examples/kea4/shared-network.json



--
Sent from: http://kea-users.7364.n8.nabble.com/
_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users