Send dhcp-users mailing list submissions to dhcp-users@lists.isc.org
To subscribe or unsubscribe via the World Wide Web, visit https://lists.isc.org/mailman/listinfo/dhcp-users or, via email, send a message with subject or body 'help' to dhcp-users-requ...@lists.isc.org You can reach the person managing the list at dhcp-users-ow...@lists.isc.org When replying, please edit your Subject line so it is more specific than "Re: Contents of dhcp-users digest..." Today's Topics: 1. Re: Same MAC - diffrent IP depending on the contex (class)? (Robert Socha) 2. Latest lease entry not the one offered to the client (Klemen Sladic) 3. Re: Same MAC - diffrent IP depending on the contex (class)? (glenn.satch...@uniq.com.au) 4. Re: Same MAC - diffrent IP depending on the contex (class)? (Robert Socha) ---------------------------------------------------------------------- Message: 1 Date: Thu, 13 Aug 2020 14:54:12 +0200 From: Robert Socha <so...@socha.it> To: dhcp-users@lists.isc.org Subject: Re: Same MAC - diffrent IP depending on the contex (class)? Message-ID: <c3e3ddc3-32c8-2103-4a09-a6326099c...@socha.it> Content-Type: text/plain; charset=utf-8; format=flowed Hi, I was unable to find solution for my problem, so I implemented it in source code. I added "match if" directive to host definition which allows me to do something like this: option client-architecture code 93 = unsigned integer 16; class "is-netboot" { match if exists client-architecture and (not (option user-class="iPXE")); } host O000C29EF4070 { hardware ethernet 00:0C:29:EF:40:70; fixed-address 20.20.20.20; option routers 10.10.10.10; option subnet-mask 255.255.255.255; } host N000C29EF4070 { match if "is-netboot"; hardware ethernet 00:0C:29:EF:40:70; fixed-address 100.64.4.2; option routers 100.64.4.1; option subnet-mask 255.255.255.252; } I also added support for globbing for include directive: include "/etc/dhcp/host/*.conf" include "/etc/dhcp/host/*/*.conf" to recursively include files from folder and subfolders. Best regards W dniu 07.08.2020 o?23:02, Robert Socha pisze: > Hi, > > I wonder if it's possible to achieve this in ISC DHCP: > > - I have static hosts only (only known clients - no dynamic assignments) > - I need to assign different addresses to host depending on if it's boot > client (PXE or UEFI), or if it's OS (linux,windows,etc) DHCP client > discover > ?? ( I need that because we use RFC3021 or /32 route-able IP > assignments to customer services and this addresses are not supported by > UEFI firmware). > > So something like this (in pseudo config) or as idea: > > > # arch-type? -> option 93 > if(if exists arch-type) { > ????# Private/netboot subnet > ????host N000c290e741d { > ??????????? hardware ethernet 00:0c:29:0e:74:1d; > ??????????? fixed-address 100.120.120.2; > ??????????? option routers 100.120.120.1; > ??????????? option subnet-mask 255.255.255.252; > ????} > } else { > ????# This for "public" network - discovers from "not boot agent" > ????host O000c290e741d? { > ??????????? hardware ethernet 00:0c:29:0e:74:1d; > ??????????? fixed-address 10.255.255.11; > ??????????? option routers 10.255.255.10; > ??????????? if option vendor-class-identifier="MSFT 5.0" { > ??????????????????? option subnet-mask 255.255.255.255; > ??????????? } else { > ??????????????????? option subnet-mask 255.255.255.254; > ??????????? } > ????} > } > > I looking for solution with static assignments (not dynamic pool's) for > netboot network (we some logic behind this assigned IP's) > > Best regards -- Robert Socha ------------------------------ Message: 2 Date: Fri, 14 Aug 2020 10:39:29 +1200 From: Klemen Sladic <gostur...@gmail.com> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Latest lease entry not the one offered to the client Message-ID: <CAN6eUaH+xE+=_D36GG7VNbnOJ1kVXbk+zr4+aM7qkQz=GG=p...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" Hi. I did not manage to find any related discussion, so I'd like to ask this: Using ISC DHCP 4.3.5 server and client. DHCP server has these two entries in its dhcpd.leases (first lease at line 106, second at line 205): lease 1.1.1.17 { starts 4 2020/08/13 00:40:24; ends 0 2020/08/23 00:40:24; tstp 0 2020/08/23 00:40:24; cltt 4 2020/08/13 00:40:24; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:0d:ca:00:0f:dd; set lease_mac = "0:d:ca:0:f:dd"; } lease 1.1.1.28 { starts 4 2020/08/13 03:03:13; ends 0 2020/08/23 03:03:13; tstp 0 2020/08/23 03:03:13; cltt 4 2020/08/13 03:03:13; binding state active; next binding state free; rewind binding state free; hardware ethernet 00:0d:ca:00:0f:dd; set lease_mac = "0:d:ca:0:f:dd"; } This made me think that 1.1.1.28 is the newest lease and should be the valid one for the client. But if I do renew on the client it is being offered 1.1.1.17 (timestamps are in different zone, port is custom): Aug 13 21:10:39 (none) daemon.info <https://slack-redir.net/link?url=http%3A%2F%2Fdaemon.info&v=3> dhclient: DHCPREQUEST on eth0 to 255.255.255.255 port 17787 Aug 13 21:10:39 (none) daemon.info <https://slack-redir.net/link?url=http%3A%2F%2Fdaemon.info&v=3> dhclient: DHCPACK from 1.1.1.1 Aug 13 21:10:41 (none) daemon.info <https://slack-redir.net/link?url=http%3A%2F%2Fdaemon.info&v=3> dhclient: bound to 1.1.1.17 -- renewal in 392208 seconds. Since some of my applications rely on knowing valid DHCP client IPs, this is a problem. I'd like to ask if that is a known issue or there may be something related to my network or DHCP config? Am I misinterpreting the dhcpd.leases file? I thought DHCP server appends most recent leases at the end? Thank you very much any help is much appreciated. RegK -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20200814/b153ae01/attachment-0001.htm> ------------------------------ Message: 3 Date: Fri, 14 Aug 2020 12:09:03 +1000 From: glenn.satch...@uniq.com.au To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Same MAC - diffrent IP depending on the contex (class)? Message-ID: <562d7634b2b7fd8380f92c6ce4382...@uniq.com.au> Content-Type: text/plain; charset=UTF-8; format=flowed Hi Robert, That's one way to do it. The other way would be to create a class and two pools for each host. In the pools have a single IP address in the range. The class would select based on PXE and ethernet. This would be ok for a few clients, but if you have hundreds it might not scale well. regards, -glenn On 2020-08-13 22:54, Robert Socha wrote: > Hi, > > I was unable to find solution for my problem, so I implemented it in > source code. > I added "match if" directive to host definition which allows me to do > something like this: > > option client-architecture code 93 = unsigned integer 16; > > class "is-netboot" { > match if exists client-architecture and (not (option > user-class="iPXE")); > } > > > host O000C29EF4070 { > hardware ethernet 00:0C:29:EF:40:70; > fixed-address 20.20.20.20; > option routers 10.10.10.10; > option subnet-mask 255.255.255.255; > } > > host N000C29EF4070 { > match if "is-netboot"; > hardware ethernet 00:0C:29:EF:40:70; > fixed-address 100.64.4.2; > option routers 100.64.4.1; > option subnet-mask 255.255.255.252; > } > > I also added support for globbing for include directive: > > include "/etc/dhcp/host/*.conf" > include "/etc/dhcp/host/*/*.conf" > > to recursively include files from folder and subfolders. > > Best regards > > > W dniu 07.08.2020 o?23:02, Robert Socha pisze: >> Hi, >> >> I wonder if it's possible to achieve this in ISC DHCP: >> >> - I have static hosts only (only known clients - no dynamic >> assignments) >> - I need to assign different addresses to host depending on if it's >> boot client (PXE or UEFI), or if it's OS (linux,windows,etc) DHCP >> client discover >> ?? ( I need that because we use RFC3021 or /32 route-able IP >> assignments to customer services and this addresses are not supported >> by UEFI firmware). >> >> So something like this (in pseudo config) or as idea: >> >> >> # arch-type? -> option 93 >> if(if exists arch-type) { >> ????# Private/netboot subnet >> ????host N000c290e741d { >> ??????????? hardware ethernet 00:0c:29:0e:74:1d; >> ??????????? fixed-address 100.120.120.2; >> ??????????? option routers 100.120.120.1; >> ??????????? option subnet-mask 255.255.255.252; >> ????} >> } else { >> ????# This for "public" network - discovers from "not boot agent" >> ????host O000c290e741d? { >> ??????????? hardware ethernet 00:0c:29:0e:74:1d; >> ??????????? fixed-address 10.255.255.11; >> ??????????? option routers 10.255.255.10; >> ??????????? if option vendor-class-identifier="MSFT 5.0" { >> ??????????????????? option subnet-mask 255.255.255.255; >> ??????????? } else { >> ??????????????????? option subnet-mask 255.255.255.254; >> ??????????? } >> ????} >> } >> >> I looking for solution with static assignments (not dynamic pool's) >> for netboot network (we some logic behind this assigned IP's) >> >> Best regards ------------------------------ Message: 4 Date: Fri, 14 Aug 2020 09:59:51 +0200 From: Robert Socha <so...@socha.it> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Same MAC - diffrent IP depending on the contex (class)? Message-ID: <6601d01c-a5bb-aab0-3ae4-25d6f1ffe...@socha.it> Content-Type: text/plain; charset=utf-8; format=flowed Hi, Thank you :) But: >>> I looking for solution with static assignments (not dynamic pool's) >>> for netboot network (we some logic behind this assigned IP's) With my patch DHCP is stateless (so I can use HA via load balancer). Best regards W dniu 14.08.2020 o?04:09, glenn.satch...@uniq.com.au pisze: > Hi Robert, > > That's one way to do it. > > The other way would be to create a class and two pools for each host. In > the pools have a single IP address in the range. The class would select > based on PXE and ethernet. This would be ok for a few clients, but if > you have hundreds it might not scale well. > > regards, > -glenn > > On 2020-08-13 22:54, Robert Socha wrote: >> Hi, >> >> I was unable to find solution for my problem, so I implemented it in >> source code. >> I added "match if" directive to host definition which allows me to do >> something like this: >> >> option client-architecture code 93 = unsigned integer 16; >> >> class "is-netboot" { >> ??????? match if exists client-architecture and (not (option >> user-class="iPXE")); >> } >> >> >> host O000C29EF4070 { >> ?? hardware ethernet 00:0C:29:EF:40:70; >> ?? fixed-address 20.20.20.20; >> ?? option routers 10.10.10.10; >> ?? option subnet-mask 255.255.255.255; >> } >> >> host N000C29EF4070 { >> ?? match if "is-netboot"; >> ?? hardware ethernet 00:0C:29:EF:40:70; >> ?? fixed-address 100.64.4.2; >> ?? option routers 100.64.4.1; >> ?? option subnet-mask 255.255.255.252; >> } >> >> I also added support for globbing for include directive: >> >> include "/etc/dhcp/host/*.conf" >> include "/etc/dhcp/host/*/*.conf" >> >> to recursively include files from folder and subfolders. >> >> Best regards >> >> >> W dniu 07.08.2020 o?23:02, Robert Socha pisze: >>> Hi, >>> >>> I wonder if it's possible to achieve this in ISC DHCP: >>> >>> - I have static hosts only (only known clients - no dynamic assignments) >>> - I need to assign different addresses to host depending on if it's >>> boot client (PXE or UEFI), or if it's OS (linux,windows,etc) DHCP >>> client discover >>> ??? ( I need that because we use RFC3021 or /32 route-able IP >>> assignments to customer services and this addresses are not supported >>> by UEFI firmware). >>> >>> So something like this (in pseudo config) or as idea: >>> >>> >>> # arch-type? -> option 93 >>> if(if exists arch-type) { >>> ?????# Private/netboot subnet >>> ?????host N000c290e741d { >>> ???????????? hardware ethernet 00:0c:29:0e:74:1d; >>> ???????????? fixed-address 100.120.120.2; >>> ???????????? option routers 100.120.120.1; >>> ???????????? option subnet-mask 255.255.255.252; >>> ?????} >>> } else { >>> ?????# This for "public" network - discovers from "not boot agent" >>> ?????host O000c290e741d? { >>> ???????????? hardware ethernet 00:0c:29:0e:74:1d; >>> ???????????? fixed-address 10.255.255.11; >>> ???????????? option routers 10.255.255.10; >>> ???????????? if option vendor-class-identifier="MSFT 5.0" { >>> ???????????????????? option subnet-mask 255.255.255.255; >>> ???????????? } else { >>> ???????????????????? option subnet-mask 255.255.255.254; >>> ???????????? } >>> ?????} >>> } >>> >>> I looking for solution with static assignments (not dynamic pool's) >>> for netboot network (we some logic behind this assigned IP's) >>> >>> Best regards > _______________________________________________ > ISC funds the development of this software with paid support > subscriptions. Contact us at https://www.isc.org/contact/ for more > information. > > dhcp-users mailing list > dhcp-users@lists.isc.org > https://lists.isc.org/mailman/listinfo/dhcp-users -- Robert Socha ------------------------------ Subject: Digest Footer _______________________________________________ ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information. dhcp-users mailing list dhcp-users@lists.isc.org https://lists.isc.org/mailman/listinfo/dhcp-users ------------------------------ End of dhcp-users Digest, Vol 142, Issue 8 ******************************************