[Kea-users] Dynamic IP address assigned to client with MAC reservation

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

[Kea-users] Dynamic IP address assigned to client with MAC reservation

Ashley Bye
Hi all,

Hoping to get some help. Whilst trying to provision some CoreOS systems, I've discovered that an IPv4 address from my dynamic range is being assigned to these machines, causing provisioning to fail.

The machines boot and install via PXE chained iPXE, which is when they are assigned their reserved IP address. During install, they reboot and I have noticed they are then being allocated an IP from the dynamic range. I suspect Kea DHCP4 server is registering this is some kind of conflict, thus causing this other allocation.

My kea4-dhcp.conf file is bloew. I'd be really grateful for any advice that can help me fix this problem.

Thanks,

Ash

{
  "Dhcp4": {
    "interfaces-config": {
      "interfaces": [ "ens192" ]
    },
    "lease-database": {
      "type": "memfile",
      "persist": true,
      "name": "/var/kea/dhcp4.leases"
    },
    "expired-leases-processing": {
      "reclaim-timer-wait-time": 10,
      "flush-reclaimed-timer-wait-time": 25,
      "hold-reclaimed-time": 3600,
      "max-reclaim-leases": 100,
      "max-reclaim-time": 250,
      "unwarned-reclaim-cycles": 5
    },
    "valid-lifetime": 4000,
    "client-classes": [
      {
        "name": "XClient_iPXE",
        "test": "substring(option[77].hex,0,4) == 'iPXE'",
        "boot-file-name": "http://matchbox.ash.k8s.internal.net:8080/boot.ipxe"
      },
      {
        "name": "UEFI-32-1",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00006'",
        "boot-file-name": "ipxe.efi"
      },
      {
        "name": "UEFI-32-2",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00002'",
        "boot-file-name": "ipxe.efi"
      },
      {
        "name": "UEFI-64-1",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00007'",
        "boot-file-name": "ipxe.efi"
      },
      {
        "name": "UEFI-64-2",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00008'",
        "boot-file-name": "ipxe.efi"
      },
      {
        "name": "UEFI-64-3",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00009'",
        "boot-file-name": "ipxe.efi"
      },
      {
        "name": "Legacy",
        "test": "substring(option[60].hex,0,20) == 'PXEClient:Arch:00000'",
        "boot-file-name": "undionly.kpxe"
      }
    ],
    "subnet4": [
      {
        "interface": "ens192",
        "subnet": "10.240.0.0/24",
        "pools": [
          {
            "pool": "10.240.0.200 - 10.240.0.240"
          }
        ],
        "option-data": [
          {
            "name": "routers",
            "code": 3,
            "space": "dhcp4",
            "csv-format": true,
            "data": "10.240.0.254"
          },
          {
            "name": "domain-name-servers",
            "code": 6,
            "space": "dhcp4",
            "csv-format": true,
            "data": "10.240.0.254"
          },
          {
            "name": "tftp-server-name",
            "code": 66,
            "space": "dhcp4",
            "csv-format": true,
            "data": "matchbox.ash.k8s.internal.net"
          }
        ],
        "reservations": [
          {
            "hw-address": "00:50:56:84:ad:c1",
            "ip-address": "10.240.0.11",
            "hostname": "controller1"
          },
          {
            "hw-address": "00:50:56:84:31:0e",
            "ip-address": "10.240.0.12",
            "hostname": "controller2"
          },
          {
            "hw-address": "00:50:56:84:8d:a9",
            "ip-address": "10.240.0.13",
            "hostname": "controller3"
          },
          {
            "hw-address": "00:50:56:84:85:a0",
            "ip-address": "10.240.0.21",
            "hostname": "worker1"
          },
          {
            "hw-address": "00:50:56:84:bb:ef",
            "ip-address": "10.240.0.22",
            "hostname": "worker2"
          },
          {
            "hw-address": "00:50:56:84:73:65",
            "ip-address": "10.240.0.23",
            "hostname": "worker3"
          }
        ]
      }
    ]
  },
  "Logging":
  {
    "loggers": [
      {
        "name": "kea-dhcp4",
        "output_options": [
          {
            "output": "/var/log/kea-dhcp4.log"
          }
        ],
        "severity": "INFO",
        "debuglevel": 0
      }
    ]
  }
}


_______________________________________________
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] Dynamic IP address assigned to client with MAC reservation

Francis Dupont
I recommend to add some debug in logs so you can verify the MAC address
and client ID. With PXE you can get some surprises with the same client
presenting different identities at each phase. Fortunately there are
some switches to force Kea to do what you want (and they are described
in the manual). If you find what did not work as you expected and how
to solve it please post your conclusion here so we can aliment FAQs and
knowledge bases... Of course this applies to anyone who got the same
problem (it is the whole principle of this list :-).

Thanks

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] Dynamic IP address assigned to client with MAC reservation

Ashley Bye
Thanks, Francis.

I'll run again in with `kea_verbose=yes`. Any chance you could give me a pointer to which switches or at least which sections in the manual I should be looking at? DHCP isn't my typical area of expertise, so I'm kind of learning as I go along.

Thanks

Ash

From: Francis Dupont <[hidden email]>
Sent: 27 March 2018 15:04
To: Ashley Bye
Cc: [hidden email]
Subject: Re: [Kea-users] Dynamic IP address assigned to client with MAC reservation
 
I recommend to add some debug in logs so you can verify the MAC address
and client ID. With PXE you can get some surprises with the same client
presenting different identities at each phase. Fortunately there are
some switches to force Kea to do what you want (and they are described
in the manual). If you find what did not work as you expected and how
to solve it please post your conclusion here so we can aliment FAQs and
knowledge bases... Of course this applies to anyone who got the same
problem (it is the whole principle of this list :-).

Thanks

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] Dynamic IP address assigned to client with MAC reservation

Francis Dupont
Using Client Identifier and Hardware Address

BTW there is an explicit reference about PXE in this.

Thanks

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] Dynamic IP address assigned to client with MAC reservation

Ashley Bye
Thanks, Francis. Very useful pointer as I’d completely missed that section in the docs.

Setting `"match-client-id": false,` fixed the problem.

I wonder if it’s perhaps adding a section with an example on configuring Kea for PXE and iPXE? I’d certainly have found it helpful rather than scrabbling around the internet to find snippets of information. That said, it may also just be my inexperience in this domain.

On Tue, Mar 27, 2018 at 15:47, Francis Dupont <[hidden email]> wrote:
Using Client Identifier and Hardware Address

BTW there is an explicit reference about PXE in this.

Thanks

Francis Dupont <[hidden email]>

_______________________________________________
Kea-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/kea-users