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. Server configuration using conditional evaluation (Thomas K?ller) 2. Re: Server configuration using conditional evaluation (Greg Sloop <gr...@sloop.net>) 3. Re: Server configuration using conditional evaluation (Thomas K?ller) 4. Re: Server configuration using conditional evaluation (Darren Ankney) ---------------------------------------------------------------------- Message: 1 Date: Sat, 11 Feb 2023 15:28:06 +0100 From: Thomas K?ller <tho...@koeller.dyndns.org> To: dhcp-users@lists.isc.org Subject: Server configuration using conditional evaluation Message-ID: <d39ecb5f-1c93-d359-ddc1-b4860dfc7...@koeller.dyndns.org> Content-Type: text/plain; charset=UTF-8; format=flowed Hi, in my DHCP server configuration I have these lines: host raspi-400 { host-identifier option dhcp6.client-id 00:02:00:00:99:5c:df:c4:9e:c6:7c:c1:7f:3e; switch (binary-to-ascii(16, 32, ".", substring(option dhcp6.ia-na, 0, 4))) { case "0": fixed-address6 fd46:1ffa:d8e0::9; option host-name "raspi-400"; break; case "2": fixed-address6 fd46:1ffa:d8e0:1::9; option host-name "raspi-400-sshvpn"; break; } } The intention is to return different data to the client, based on the IAID received. However, I apparently got the syntax wrong, although I cannot spot any mistake: [root@sarkovy ~]# dhcpd -6 -cf /etc/dhcp/dhcpd6.conf -t Internet Systems Consortium DHCP Server 4.4.3-P1 Copyright 2004-2022 Internet Systems Consortium. All rights reserved. For info, please visit https://www.isc.org/software/dhcp/ lease_id_format is: hex /etc/dhcp/dhcpd6.conf line 80: right brace expected. fixed-address6 ^ /etc/dhcp/dhcpd6.conf line 83: case statement in inappropriate scope. case ^ /etc/dhcp/dhcpd6.conf line 87: expecting a declaration } ^ Configuration file errors encountered -- exiting This version of ISC DHCP is based on the release available on ftp.isc.org. Features have been added and other changes have been made to the base software release in order to make it work better with this distribution. Please report issues with this software via: https://bugzilla.redhat.com/ exiting. Can anybody explain what's wrong? Thomas ------------------------------ Message: 2 Date: Sat, 11 Feb 2023 09:09:12 -0800 From: "Greg Sloop <gr...@sloop.net>" <gr...@sloop.net> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Server configuration using conditional evaluation Message-ID: <caajorqxp2jw2gqn0yzkyvn9ecr9o0h3h8gy4nczmz+qntse...@mail.gmail.com> Content-Type: text/plain; charset="utf-8" This config didn't start out as a Windows file with cr lf line endings did it? (And is still in that format?) On Sat, Feb 11, 2023, 6:30 AM Thomas K?ller <tho...@koeller.dyndns.org> wrote: > Hi, > > in my DHCP server configuration I have these lines: > > host raspi-400 { > host-identifier option dhcp6.client-id > 00:02:00:00:99:5c:df:c4:9e:c6:7c:c1:7f:3e; > switch (binary-to-ascii(16, 32, ".", substring(option dhcp6.ia-na, 0, > 4))) { > case "0": > fixed-address6 fd46:1ffa:d8e0::9; > option host-name "raspi-400"; > break; > case "2": > fixed-address6 fd46:1ffa:d8e0:1::9; > option host-name "raspi-400-sshvpn"; > break; > } > } > > The intention is to return different data to the client, based on the > IAID received. However, I apparently got the syntax wrong, although I > cannot spot any mistake: > > [root@sarkovy ~]# dhcpd -6 -cf /etc/dhcp/dhcpd6.conf -t > Internet Systems Consortium DHCP Server 4.4.3-P1 > Copyright 2004-2022 Internet Systems Consortium. > All rights reserved. > For info, please visit https://www.isc.org/software/dhcp/ > lease_id_format is: hex > /etc/dhcp/dhcpd6.conf line 80: right brace expected. > fixed-address6 > ^ > /etc/dhcp/dhcpd6.conf line 83: case statement in inappropriate scope. > case > ^ > /etc/dhcp/dhcpd6.conf line 87: expecting a declaration > } > ^ > Configuration file errors encountered -- exiting > > This version of ISC DHCP is based on the release available > on ftp.isc.org. Features have been added and other changes > have been made to the base software release in order to make > it work better with this distribution. > > Please report issues with this software via: > https://bugzilla.redhat.com/ > > exiting. > > Can anybody explain what's wrong? > > Thomas > -- > 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 > -------------- next part -------------- An HTML attachment was scrubbed... URL: <https://lists.isc.org/pipermail/dhcp-users/attachments/20230211/bd769e96/attachment-0001.htm> ------------------------------ Message: 3 Date: Sat, 11 Feb 2023 18:19:43 +0100 From: Thomas K?ller <tho...@koeller.dyndns.org> To: dhcp-users@lists.isc.org Subject: Re: Server configuration using conditional evaluation Message-ID: <a66ae823-4435-36ae-c76e-588c56e5e...@koeller.dyndns.org> Content-Type: text/plain; charset=UTF-8; format=flowed Am 11.02.23 um 18:09 schrieb Greg Sloop <gr...@sloop.net>: > This config didn't start out as a Windows file with cr lf line endings > did it? (And is still in that format?) No, definitely not, all line endings ar lf only. ------------------------------ Message: 4 Date: Sun, 12 Feb 2023 06:47:44 -0500 From: Darren Ankney <darren.ank...@gmail.com> To: Users of ISC DHCP <dhcp-users@lists.isc.org> Subject: Re: Server configuration using conditional evaluation Message-ID: <CAKabWHiypobK=dcjg__necgydxq2fb5mvinpnghmyjbmb14...@mail.gmail.com> Content-Type: text/plain; charset="UTF-8" The error could start earlier than what you've shown here. Have a look earlier in your file and see if there are missing } or if there are unterminated ' or " which would mask your ending } ATM, I can't seem to find man pages for ISC DHCP documenting the use of switch, so I'll just assume you've used the correct syntax there. On Sat, Feb 11, 2023 at 12:20 PM Thomas K?ller <tho...@koeller.dyndns.org> wrote: > > Am 11.02.23 um 18:09 schrieb Greg Sloop <gr...@sloop.net>: > > This config didn't start out as a Windows file with cr lf line endings > > did it? (And is still in that format?) > > No, definitely not, all line endings ar lf only. > -- > 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 ------------------------------ 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 171, Issue 4 ******************************************