[Kea-users] Client classification based on MAC vendor prefix + multi-subnet DDNS
Tobias -
lokskada at live.se
Sat Jan 20 11:20:16 UTC 2018
On 2018-01-20 09:55, Francis Dupont wrote:
> I can't see what is in the ... in subnet definitions but I am afraid
> there is no "interface": "br0" so no subnet can't be selected from
> the incoming packet. I sent in this a description of the algorithm
> of the subnet selection. To summary with a broadcast packet from a
> directly connected client without specific options the only thing
> which works is to match the interface. When you have a class guard
> in a subnet definition either the packet is in the class and this
> subnet is selected, or it is not and this subnet is rejected and
> the next (in the config file order) subnet is tried. Note this
> applies to subnets in a shared network, i.e. a class guard in
> a subnet entry is strict: pools or reservations under the subnet
> are only for class members (i.e. it is not the ISC DHCP behavior
> and class for pools (which I expect to be merged next week)
> will be different too).
>
> About the classes themselves I expect the branch where I added logical
> expressions using classes will be reviewed soon so you should no longer
> need to evaluate twice the substring equal expression.
>
> For the "not using the classes" I can't say because I lack infos.
> If you use Kea 1.3 perhaps you should try a shared network
> as pools and host reservations in a shared network are for the whole
> shared network as soon as they are not under a subnet with a class guard.
>
> Pools with class could help too but they are not yet available.
>
> Thanks
>
> Francis Dupont <fdupont at isc.org>
Hi Francis!
Thank you for helping me out.Yes, I run version 1.3.0.
I managed to get the reservation going after using "shared-networks"
like you suggested and specifying the interface in the subnets.
Everything is fine except that the FQDN sent back to the client is in
the domain specified in subnet 1 but it gets the rest of the
configuration from subnet 2.
The complete configuration looks like this:
> {
> "Dhcp4": {
> "interfaces-config": {
> "interfaces": [
> "br0"
> ],
> "dhcp-socket-type": "raw"
> },
> "control-socket": {
> "socket-type": "unix",
> "socket-name": "/tmp/kea-dhcp4-ctrl.sock"
> },
> "lease-database": {
> "type": "mysql",
> "name": "kea",
> "user": "kea",
> "password": "password",
> "lfc-interval": 3600
> },
> "hosts-database": {
> "type": "mysql",
> "name": "kea",
> "user": "kea",
> "password": "password"
> },
> "valid-lifetime": 4000,
> "renew-timer": 1000,
> "rebind-timer": 2000,
> "option-data": [
> {
> "name": "default-ip-ttl",
> "data": "0xf0"
> }
> ],
> "client-classes": [
> {
> "name": "none",
> "test": "not (substring(pkt4.mac, 0, 3) == 0x525400)"
> },
> {
> "name": "vm",
> "test": "substring(pkt4.mac, 0, 3) == 0x525400"
> }
> ],
> "shared-networks": [
> {
> "name": "local-networks",
> "interface": "br0",
> "subnet4": [
> {
> "subnet": "192.168.0.0/24",
> "id": 1,
> "client-class": "none",
> "pools": [
> {
> "pool": "192.168.0.50 - 192.168.0.199"
> }
> ],
> "reservation-mode": "out-of-pool",
> "option-data": [
> {
> "name": "domain-name-servers",
> "data": "192.168.0.1"
> },
> {
> "name": "domain-name",
> "data": "dhcp.local.intra"
> },
> {
> "name": "domain-search",
> "data": "local.intra, vm.local.intra, dhcp.local.intra"
> },
> {
> "name": "routers",
> "data": "192.168.0.1"
> }
> ]
> },
> {
> "subnet": "192.168.1.0/24",
> "id": 2,
> "client-class": "vm",
> "pools": [
> {
> "pool": "192.168.1.224 - 192.168.1.254"
> }
> ],
> "reservation-mode": "out-of-pool",
> "option-data": [
> {
> "name": "domain-name-servers",
> "data": "192.168.1.1"
> },
> {
> "name": "domain-name",
> "data": "vm.local.intra"
> },
> {
> "name": "domain-search",
> "data": "local.intra, vm.local.intra, dhcp.local.intra"
> },
> {
> "name": "routers",
> "data": "192.168.1.1"
> }
> ]
> }
> ]
> }
> ],
> "dhcp-ddns": {
> "enable-updates": false,
> "override-client-update": true,
> "override-no-update": true,
> "replace-client-name": "always",
> "generated-prefix": "host",
> "qualifying-suffix": "dhcp.local.intra."
> }
> },
> "Logging": {
> "loggers": [
> {
> "name": "kea-dhcp4",
> "output_options": [
> {
> "output": "syslog"
> }
> ],
> "severity": "DEBUG",
> "debuglevel": 55
> }
> ]
> }
> }
Does this mean that I have to specify the FQDN in the hosts table? I
tried that but it concatenated the two domains instead of going with the
specified hostname.
I also get this error:
> [kea-dhcp4.dhcpsrv/18862] DHCPSRV_MULTIPLE_RAW_SOCKETS_PER_IFACE
current configuration will result in opening multiple broadcast capable
sockets on some interfaces and some DHCP messages may be duplicated
What can I do in my config to get around this? I don't like the sound of
duplicate messages.
The interface has both 192.168.0.1/24 and 192.168.1.1/24.
I'm just experimenting so any suggestion is welcome.
Thank you,
Tobias
More information about the Kea-users
mailing list