[Kea-users] DHCP Classes Kea Configuration

Francis Dupont fdupont at isc.org
Fri Dec 7 12:47:39 UTC 2018


Jordan Tinsley writes:
> Can you translate the shared networks example from ISC to Kea?

=> I attached the ISC DHCP config and the result of the Migration
Assistant applied to it. Note the max-lease-time feature should be
implemented in the Kea next release (1.6 just after the 1.5 which
is planned for a fea days) so the number of not translated items
should go closer to 0. The references are for gitlab Kea issues
so you can look at them (they are locked so if you have comments
please send them to us, e.g. using this list).

Regards

Francis Dupont <fdupont at isc.org>

PS: if you'd like I can add the config into the Migration Assistant tests
(I already have a lot of samples, the first one from the ISC network admin).
-------------- next part --------------
class "APPLE" {
         
        match if ( substring (hardware,1,3) = b0:19:c6 ) or
                ( substring (hardware,1,3) = d8:a2:5e ) or
                ( substring (hardware,1,3) = b8:c7:5d ) or
                ( substring (hardware,1,3) = 6c:70:9f ) or
                ( substring (hardware,1,3) = 88:1f:a1 );

}

class "BELKIN" {
         match if ( substring (hardware,1,3) = 60:38:e0 ) or
                ( substring (hardware,1,3) = 58:ef:58 ) or
                ( substring (hardware,1,3) = 58:ef:68 );

}




## Pool 1
shared-network "pool 1" {
subnet 192.168.1.0 netmask 255.255.255.0 {

       option domain-name-servers 8.8.8.8, 8.8.4.4;
       option routers 192.168.1.1;
       option broadcast-address 192.168.1.255;
       default-lease-time 259200;
       max-lease-time 259200;

        pool {

                range 192.168.1.2 192.168.1.254;


                allow members of "APPLE";
		allow members of "BELKIN";

}
}
}

## Pool 2
shared-network "pool 2" {
subnet 192.168.2.0 netmask 255.255.255.0 {

       option domain-name-servers 8.8.8.8, 8.8.4.4;
       option routers 192.168.2.1;
       option broadcast-address 192.168.2.255;
       default-lease-time 259200;
       max-lease-time 259200;

        pool {

                range 192.168.2.2 192.168.2.254;


                allow members of "APPLE";
		allow members of "BELKIN";

}
}
}
-------------- next part --------------
{
  /// This configuration declares some subnets but has no interfaces-config
  /// Reference Kea #245
  "Dhcp4": {
    "client-classes": [
      {
        "name": "APPLE",
        /// from: match if ((substring(hardware, 1, 3)) = 0xb019c6) or ((substring(hardware, 1, 3)) = 0xd8a25e) or ((substring(hardware, 1, 3)) = 0xb8c75d) or ((substring(hardware, 1, 3)) = 0x6c709f) or ((substring(hardware, 1, 3)) = 0x881fa1)
        "test": "((((substring(pkt4.mac,0,3) == 0xb019c6) or (substring(pkt4.mac,0,3) == 0xd8a25e)) or (substring(pkt4.mac,0,3) == 0xb8c75d)) or (substring(pkt4.mac,0,3) == 0x6c709f)) or (substring(pkt4.mac,0,3) == 0x881fa1)"
      },
      {
        "name": "BELKIN",
        /// from: match if ((substring(hardware, 1, 3)) = 0x6038e0) or ((substring(hardware, 1, 3)) = 0x58ef58) or ((substring(hardware, 1, 3)) = 0x58ef68)
        "test": "((substring(pkt4.mac,0,3) == 0x6038e0) or (substring(pkt4.mac,0,3) == 0x58ef58)) or (substring(pkt4.mac,0,3) == 0x58ef68)"
      },
      {
        "name": "gen#APPLE#BELKIN#",
        "test": "member('APPLE') or member('BELKIN')"
      }
    ],
    "subnet4": [
      {
        "id": 1,
        "subnet": "192.168.1.0/24",
        "option-data": [
          {
            "space": "dhcp4",
            "name": "domain-name-servers",
            "code": 6,
            "data": "8.8.8.8, 8.8.4.4"
          },
          {
            "space": "dhcp4",
            "name": "routers",
            "code": 3,
            "data": "192.168.1.1"
          },
          {
            "space": "dhcp4",
            "name": "broadcast-address",
            "code": 28,
            "data": "192.168.1.255"
          }
        ],
        "valid-lifetime": 259200,
//      "config": [
//        /// max-lease-time is not supported
//        /// use default-lease-time instead
//        /// Reference Kea #221
//        {
//          "name": "max-lease-time",
//          "code": 2,
//          "value": 259200
//        }
//      ],
        "pools": [
          {
            "pool": "192.168.1.2 - 192.168.1.254",
            /// From:
            ///   allow APPLE
            ///   allow BELKIN
            "client-class": "gen#APPLE#BELKIN#"
          }
        ]
      },
      {
        "id": 2,
        "subnet": "192.168.2.0/24",
        "option-data": [
          {
            "space": "dhcp4",
            "name": "domain-name-servers",
            "code": 6,
            "data": "8.8.8.8, 8.8.4.4"
          },
          {
            "space": "dhcp4",
            "name": "routers",
            "code": 3,
            "data": "192.168.2.1"
          },
          {
            "space": "dhcp4",
            "name": "broadcast-address",
            "code": 28,
            "data": "192.168.2.255"
          }
        ],
        "valid-lifetime": 259200,
//      "config": [
//        /// max-lease-time is not supported
//        /// use default-lease-time instead
//        /// Reference Kea #221
//        {
//          "name": "max-lease-time",
//          "code": 2,
//          "value": 259200
//        }
//      ],
        "pools": [
          {
            "pool": "192.168.2.2 - 192.168.2.254",
            /// From:
            ///   allow APPLE
            ///   allow BELKIN
            "client-class": "gen#APPLE#BELKIN#"
          }
        ]
      }
    ]
  }
}


More information about the Kea-users mailing list